![]() 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-card/js/dom/CDayCell.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; require("../../css/cdaycell.css"); var _Core = _interopRequireDefault(require("./Core")); var _datetime = require("absol/src/Time/datetime"); var _ = _Core.default._; var $ = _Core.default.$; var defaultDate = (0, _datetime.beginOfDay)(new Date()); function CDayCell() { this.$number = $('.cd-day-cell-number', this); this.$mmmmdd = $('.cd-day-cell-mmmdd', this); /** * @type {Text} */ this.$numberText = this.$number.firstChild; /** * @type {Text} */ this.$mmmmddText = this.$mmmmdd.firstChild; this._date = new Date(); this.date = this._date; this._day = 0; } CDayCell.tag = 'CDayCell'.toLowerCase(); CDayCell.render = function () { return _({ class: ['cd-day-cell', 'cd-day-0'], child: [{ class: 'cd-day-cell-nav', child: [{ tag: 'span', class: 'cd-day-cell-number', child: { text: '' } }, { tag: 'span', class: 'cd-day-cell-mmmdd', child: { text: '' } }] }] }); }; CDayCell.prototype.clearChild = function () { var children = Array.prototype.slice.call(this.children); var child; for (var i = 0; i < children.length; ++i) { child = children[i]; if (child != this.$mmmmdd && child != this.$number) this.removeChild(children[i]); } }; CDayCell.property = {}; /** * @type {CDayCell} */ CDayCell.property.date = { /** * * @param {Date} value */ set: function (value) { value = value || defaultDate; var day = value.getDay(); if (day != this._day) { this.removeClass('cd-day-' + this._day); this._day = day; this.addClass('cd-day-' + this._day); } this._date = value; this.$numberText.data = value.getDate(); this.$mmmmddText.data = (0, _datetime.formartDateString)(value, 'mmmm-dd'); if ((0, _datetime.compareDate)(defaultDate, value) == 0) this.addClass('cd-today');else this.removeClass('cd-today'); if (value.getDate() == 1) { this.addClass('cd-first-day-of-month'); } else { this.removeClass('cd-first-day-of-month'); } }, /** * @returns {Date} */ get: function () { return this._date; } }; /** * @type {CDayCell} */ CDayCell.property.selected = { set: function (value) { if (value) this.addClass('cd-selected');else this.removeClass('cd-selected'); }, get: function () { return this.containsClass('cd-selected'); } }; _Core.default.install(CDayCell); var _default = CDayCell; exports.default = _default;