![]() 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-form/js/components/ |
Upload File : |
import FCore from "../core/FCore"; import '../../css/component.css'; import ContentScalelessComponent from "../core/ContentScalelessComponent"; import Text from "./Text"; import OOP from "absol/src/HTML5/OOP"; import TextStyleHandlers from "./handlers/TextStyleHandlers"; import inheritComponentClass from "../core/inheritComponentClass"; import {AssemblerInstance} from "../core/Assembler"; var _ = FCore._; var $ = FCore.$; /*** * @extends ContentScalelessComponent * @constructor */ function Label() { ContentScalelessComponent.call(this); } inheritComponentClass(Label, ContentScalelessComponent); Object.assign(Label.prototype.styleHandlers, TextStyleHandlers); Label.prototype.attributeHandlers.text = { set: function (value) { value = (value || '') + ''; this.$content.clearChild().addChild(_({ text: value })); return value; }, descriptor: { type: "text", long: false, sign: "innerText" } } Label.prototype.tag = "Label"; Label.prototype.menuIcon = 'span.mdi.mdi-label-outline'; Label.prototype.onCreate = function () { ContentScalelessComponent.prototype.onCreate.call(this); this.attributes.text = this.attributes.name; this.style.height = 'auto'; this.style.font = undefined; this.style.fontStyle = undefined; this.style.textSize = 0; this.style.textColor = 'black'; this.attributes.dataBinding = false; }; Label.prototype.renderContent = function () { return _('label'); }; Label.prototype.createDataBindingDescriptor = function () { var thisC = this; return { get: function () { return thisC.getAttribute('text'); }, set: function (value) { thisC.setAttribute('text', value); } }; }; AssemblerInstance.addClass(Label); export default Label;