![]() 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-form/js/components/TextInput.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")); require("../../css/component.css"); var _Text = _interopRequireDefault(require("./Text")); var _inheritComponentClass = _interopRequireDefault(require("../core/inheritComponentClass")); var _InputAttributeHandlers = _interopRequireWildcard(require("./handlers/InputAttributeHandlers")); var _Assembler = require("../core/Assembler"); var _InputStyleHandlers = _interopRequireDefault(require("./handlers/InputStyleHandlers")); var _ = _FCore.default._; /*** * @extends ScalableComponent * @constructor */ function TextInput() { _ScalableComponent.default.call(this); } (0, _inheritComponentClass.default)(TextInput, _ScalableComponent.default, _Text.default); delete TextInput.prototype.attributeHandlers.text; delete TextInput.prototype.attributeHandlers.textDecode; TextInput.prototype.tag = "TextInput"; TextInput.prototype.menuIcon = "span.mdi.mdi-form-textbox"; TextInput.prototype.SUPPORT_ATTRIBUTE_NAMES = ['value']; TextInput.prototype.SUPPORT_EVENT_NAMES = ['change']; Object.assign(TextInput.prototype.attributeHandlers, _InputAttributeHandlers.default); Object.assign(TextInput.prototype.styleHandlers, _InputStyleHandlers.default); TextInput.prototype.style.vAlign = 'center'; TextInput.prototype.style.display = 'inline-block'; TextInput.prototype.attributeHandlers.value = { set: function (value) { var prev = this.domElt.value; this.domElt.value = value; if (this.domElt.updateSize) { this.domElt.updateSize(); //textarea2 module } if (prev !== this.domElt.value) { this.pinFire('value'); this.notifyChange(); } }, get: function () { return this.domElt.value; }, descriptor: { type: "text", sign: "SimpleText" } }; TextInput.prototype.attributeHandlers.placeHolder = { set: function (value) { this.domElt.placeholder = value; }, get: function () { return this.domElt.placeholder; }, descriptor: { type: "text", sign: "TextPlaceHolder" }, export: function () { var value = this.domElt.placeholder; return value || undefined; } }; TextInput.prototype.attributeHandlers.textType = { set: function (value) { if (['normal', 'password'].indexOf(value) < 0) value = 'normal'; this.domElt.attr('type', { normal: 'text', password: 'password' }[value]); if (value === 'password') this.domElt.attr('autocomplete', 'new-password');else this.domElt.attr('autocomplete', undefined); return value; }, descriptor: { type: "enum", values: ['normal', 'password'], sign: 'InputTextType' }, export: function () { var ref = arguments[arguments.length - 1]; var value = ref.get(); return value === 'normal' ? undefined : value; } }; TextInput.prototype.pinHandlers.value = { get: function () { return this.attributes.value; }, receives: function (value) { this.attributes.value = value; } }; TextInput.prototype.pinHandlers.disabled = { receives: function (value) { this.attributes.disabled = value; } }; TextInput.prototype.pinHandlers.blur = { get: function () { return true; } }; TextInput.prototype.pinHandlers.userModified = { get: function () { return true; } }; TextInput.prototype.onCreated = function () { _ScalableComponent.default.prototype.onCreated.call(this); var self = this; var lastValue; this.domElt.on('focus', function () { lastValue = this.value; }).on('keyup', function (event) { if (this.value !== lastValue) { self.pinFire('userModified'); self.pinFire('value'); self.notifyChange(); lastValue = this.value; } }).on('blur', function () { if (this.value !== lastValue) { self.pinFire('value'); self.notifyChange(); lastValue = this.value; } self.pinFire('blur'); }); }; TextInput.prototype.onCreate = function () { _ScalableComponent.default.prototype.onCreate.call(this); this.style.textAlign = 'left'; this.attributes.value = ''; this.attributes.placeHolder = ''; this.style.textType = 'normal'; this.style.textColor = 'black'; this.style.textSize = 0; this.style.textAlign = 'left'; this.style.font = 'unset'; }; TextInput.prototype.render = function () { return _('input[type="text"][autocomplete="off"].as-text-input'); }; TextInput.prototype.getAcceptsStyleNames = function () { return _Text.default.prototype.getAcceptsStyleNames.call(this); }; TextInput.prototype.createDataBindingDescriptor = function () { var thisC = this; return { configurable: true, set: function (value) { thisC.setAttribute('value', value); }, get: function () { return thisC.getAttribute('value'); } }; }; TextInput.prototype.verify = function () { if (this.attributes.required) { if (this.attributes.value.trim().length > 0) { return { completed: true }; } else { return { completed: false, comp: this }; } } else { return { completed: true }; } }; _Assembler.AssemblerInstance.addClass(TextInput); var _default = TextInput; exports.default = _default;