![]() 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/WeekInput.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")); var _datetime = require("absol/src/Time/datetime"); var _inheritComponentClass = _interopRequireDefault(require("../core/inheritComponentClass")); var _InputAttributeHandlers = _interopRequireWildcard(require("./handlers/InputAttributeHandlers")); var _Assembler = require("../core/Assembler"); var _InputStyleHandlers = _interopRequireDefault(require("./handlers/InputStyleHandlers")); var _DateInput = _interopRequireDefault(require("./DateInput")); var _ = _FCore.default._; /*** * @extends ScalableComponent * @constructor */ function WeekInput() { _ScalableComponent.default.call(this); } (0, _inheritComponentClass.default)(WeekInput, _ScalableComponent.default); WeekInput.prototype.tag = "WeekInput"; WeekInput.prototype.menuIcon = "span.mdi.mdi-calendar-week"; WeekInput.prototype.SUPPORT_EVENT_NAMES = ['change']; Object.assign(WeekInput.prototype.attributeHandlers, _InputAttributeHandlers.default); Object.assign(WeekInput.prototype.styleHandlers, _InputStyleHandlers.default); WeekInput.prototype.attributes.format = 'Tuần ww, yyyy'; WeekInput.prototype.style.vAlign = 'center'; WeekInput.prototype.style.display = 'inline-block'; WeekInput.prototype.attributeHandlers.value = { set: function (value) { var prev = this.domElt.value; if (value instanceof Date) this.domElt.value = value;else if (typeof value == 'string' || typeof value == "number") { value = new Date(value); this.domElt.value = value; } else { value = null; this.domElt.value = null; } var cur = this.domElt.value; if (!!prev !== !!cur || prev && cur && (0, _datetime.compareDate)(prev, cur) !== 0) { this.pinFire('value'); this.notifyChange(); } }, get: function () { return this.view.value; }, descriptor: { type: 'date', nullable: true, defaultValue: (0, _datetime.beginOfDay)(new Date()), sign: 'SimpleDate' } }; WeekInput.prototype.attributeHandlers.format = { set: function (value) { this.domElt.format = value || 'Tuần ww, yyyy'; }, get: function () { return this.domElt.format; }, descriptor: { type: 'enum', values: ['Tuần ww, yyyy', 'Week ww, yyyy'] }, export: function () { var val = this.attributes.format; if (val === 'Tuần ww, yyyy') return null; return val || null; } }; WeekInput.prototype.attributeHandlers.notNull = _DateInput.default.prototype.attributeHandlers.notNull; WeekInput.prototype.pinHandlers.min = { receives: function (value) { this.domElt.min = value; }, descriptor: { type: "Date" } }; WeekInput.prototype.pinHandlers.max = { receives: function (value) { this.domElt.max = value; }, descriptor: { type: "Date" } }; WeekInput.prototype.pinHandlers.value = { receives: function (value) { this.attributes.value = value; }, get: function () { return this.domElt.value; }, descriptor: { type: "Date" } }; WeekInput.prototype.render = function () { return _('dateinput'); }; WeekInput.prototype.onCreate = function () { _ScalableComponent.default.prototype.onCreate.call(this); this.attributes.value = null; this.style.width = 100; this.style.height = 30; }; WeekInput.prototype.onCreated = function () { _ScalableComponent.default.prototype.onCreated.call(this); this.domElt.on('change', this.ev_inputChange.bind(this)); }; WeekInput.prototype.measureMinSize = function () { return { width: 75, height: 16 }; }; WeekInput.prototype.createDataBindingDescriptor = function () { var thisC = this; return { configurable: true, set: function (value) { thisC.attributes.value = value; }, get: function () { return thisC.attributes.value; } }; }; WeekInput.prototype.ev_inputChange = function () { this.pinFire('value'); this.notifyChange(); }; _Assembler.AssemblerInstance.addClass(WeekInput); var _default = WeekInput; exports.default = _default;