![]() 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 : |
/*** module: node_modules/absol-acomp/js/WindowBox.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ACore = _interopRequireWildcard(require("../ACore")); var _OOP = _interopRequireDefault(require("absol/src/HTML5/OOP")); /** * @typedef WindowBoxAction * @property icon * @property name * */ /*** * @extends AElement * @constructor */ function WindowBox() { this.$header = (0, _ACore.$)('.as-window-box-header', this); /*** * * @type {WindowBoxAction[]} * @private */ this._windowActions = []; this.$windowActionButtonCtn = (0, _ACore.$)('.as-window-box-header-button-ctn', this); this._windowIcon = null; this.$windowIconCtn = (0, _ACore.$)('.as-window-box-header-icon-ctn', this); /** * * @type {Text} */ this.$windowTitleText = (0, _ACore.$)('.as-window-box-header-title', this).firstChild; this.$body = (0, _ACore.$)('.as-window-box-body', this); /*** * @type {WindowBoxAction[]} * @name windowActions */ } WindowBox.tag = 'WindowBox'.toLowerCase(); WindowBox.render = function () { return (0, _ACore._)({ class: 'as-window-box', extendEvent: ['action'], child: [{ class: 'as-window-box-header', child: [{ class: 'as-window-box-header-icon-ctn' }, { class: 'as-window-box-header-title', child: { text: '' } }, { class: "as-window-box-header-button-ctn" }] }, { class: 'as-window-box-body' }] }); }; ['addChild', 'addChildBefore', 'addChildAfter', 'clearChild', 'findChildBefore', 'findChildAfter'].forEach(function (key) { WindowBox.prototype[key] = function () { return this.$body[key].apply(this.$body, arguments); }; }); WindowBox.property = {}; WindowBox.property.windowTitle = { set: function (value) { this.$windowTitleText.data = (value || '') + ''; }, get: function () { return this.$windowTitleText.data; }, enumerable: true }; WindowBox.property.windowIcon = { /*** * @this WindowBox * @param value */ set: function (value) { value = value || null; this.$windowIconCtn.clearChild(); if (value) { this.$windowIconCtn.addChild((0, _ACore._)(value)); } this._windowIcon = value; }, get: function () { return this._windowIcon; }, enumerable: true }; WindowBox.property.windowActions = { set: function (actions) { var self = this; this._windowActions = actions || []; this.$windowActionButtonCtn.clearChild(); var buttons = this._windowActions.map(function (action) { return (0, _ACore._)({ tag: 'button', class: action.class || [], child: action.icon, on: { click: function (event) { var eventData = { type: 'action', target: self, action: action, originalEvent: event }; _OOP.default.drillProperty(eventData, eventData, 'actionData', 'action'); self.emit('action', eventData, self); } } }); }); this.$windowActionButtonCtn.addChild(buttons); }, get: function () { return this._windowActions; } }; _ACore.default.install(WindowBox); var _default = WindowBox; exports.default = _default;