![]() 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 ScalableComponent from "../core/ScalableComponent"; import {_} from "../core/FCore"; import inheritComponentClass from "../core/inheritComponentClass"; import InputAttributeHandlers, {InputAttributeNames} from "./handlers/InputAttributeHandlers"; import {AssemblerInstance} from "../core/Assembler"; /*** * @extends ScalableComponent * @constructor */ function DateTimeInput() { ScalableComponent.call(this); } inheritComponentClass(DateTimeInput, ScalableComponent); DateTimeInput.prototype.tag = 'DateTimeInput'; DateTimeInput.prototype.menuIcon = 'span.mdi.mdi-calendar-clock'; DateTimeInput.prototype.onCreate = function () { ScalableComponent.prototype.onCreate.call(this); this.style.width = 174; this.style.height = 30; this.attributes.format = 'dd/MM/yyyy hh:mm a'; }; Object.assign(DateTimeInput.prototype.attributeHandlers, InputAttributeHandlers); DateTimeInput.prototype.attributeHandlers.format = { set: function (value) { this.domElt.format = value; }, get: function () { return this.domElt.format; }, descriptor: { type: 'DateTimeFormat' }, export: function () { var value = this.format; if (value === 'dd/MM/yyyy hh:mm a') return undefined; return value; } }; DateTimeInput.prototype.attributeHandlers.value = { set: function (value) { var prev = this.domElt.value; this.domElt.value = value; var cur = this.domElt.value; if (!prev !== !cur || (prev && cur && prev.getTime() === cur.getTime())) this.pinFire('value'); }, get: function () { return this.domElt.value; }, descriptor: { type: 'DateTime' }, export: function () { return this.value || undefined; } }; DateTimeInput.prototype.pinHandlers.value = { receives: function (value) { this.domElt.value = value; }, get: function () { return this.domElt.value; }, descriptor: { type: "Date" } }; DateTimeInput.prototype.onCreated = function () { this.domElt.on('change', function () { this.pinFire('value'); }.bind(this)); }; DateTimeInput.prototype.render = function () { return _({ tag: 'datetimeinput' }); }; DateTimeInput.prototype.createDataBindingDescriptor = function (){ var thisC = this; return { configurable: true, set: function (value) { thisC.attributes.value = value; }, get: function () { return thisC.attributes.value; } }; }; AssemblerInstance.addClass(DateTimeInput); export default DateTimeInput;