funda-ui 4.5.575 → 4.5.585
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EventCalendar/index.js +28 -7
- package/EventCalendarTimeline/index.js +50 -20
- package/lib/cjs/EventCalendar/index.js +28 -7
- package/lib/cjs/EventCalendarTimeline/index.js +50 -20
- package/lib/esm/EventCalendar/index.tsx +26 -7
- package/lib/esm/EventCalendarTimeline/index.tsx +51 -23
- package/lib/esm/ModalDialog/index.tsx +0 -1
- package/package.json +1 -1
package/EventCalendar/index.js
CHANGED
|
@@ -2867,6 +2867,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2867
2867
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2868
2868
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2869
2869
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2870
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2871
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2872
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2873
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
2874
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2870
2875
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2871
2876
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
2872
2877
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -3225,7 +3230,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3225
3230
|
})
|
|
3226
3231
|
};
|
|
3227
3232
|
};
|
|
3228
|
-
function
|
|
3233
|
+
function updateTodayDate(inputDate) {
|
|
3229
3234
|
setDay(inputDate.getDate());
|
|
3230
3235
|
setMonth(inputDate.getMonth());
|
|
3231
3236
|
setYear(inputDate.getFullYear());
|
|
@@ -3306,7 +3311,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3306
3311
|
function handleTodayChange() {
|
|
3307
3312
|
setSelectedMonth(now.getMonth());
|
|
3308
3313
|
setSelectedYear(now.getFullYear());
|
|
3309
|
-
|
|
3314
|
+
updateTodayDate(now);
|
|
3310
3315
|
|
|
3311
3316
|
//
|
|
3312
3317
|
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getTodayDate)().split('-');
|
|
@@ -3344,7 +3349,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3344
3349
|
});
|
|
3345
3350
|
}, [year]);
|
|
3346
3351
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
3347
|
-
|
|
3352
|
+
updateTodayDate(date);
|
|
3348
3353
|
}, [date]);
|
|
3349
3354
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
3350
3355
|
// update events value
|
|
@@ -3353,7 +3358,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3353
3358
|
// update current today
|
|
3354
3359
|
if (typeof customTodayDate === 'string' && customTodayDate !== '' && (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.isValidDate)(customTodayDate)) {
|
|
3355
3360
|
var _customNow = new Date(customTodayDate);
|
|
3356
|
-
|
|
3361
|
+
updateTodayDate(_customNow);
|
|
3357
3362
|
}
|
|
3358
3363
|
|
|
3359
3364
|
// Call a function when the list has been rendered completely
|
|
@@ -3486,7 +3491,13 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3486
3491
|
if (isInteractive) {
|
|
3487
3492
|
handleDayChange(e, d); // update current day
|
|
3488
3493
|
|
|
3489
|
-
|
|
3494
|
+
//
|
|
3495
|
+
var _now = cellItem.date.split('-');
|
|
3496
|
+
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _objectSpread(_objectSpread({}, cellItem), {}, {
|
|
3497
|
+
day: _now[2],
|
|
3498
|
+
month: _now[1],
|
|
3499
|
+
year: _now[0]
|
|
3500
|
+
}));
|
|
3490
3501
|
if (EVENTS_ENABLED) {
|
|
3491
3502
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(cellItem, function () {
|
|
3492
3503
|
return setShowEdit(true);
|
|
@@ -3521,9 +3532,14 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3521
3532
|
if (isInteractive) {
|
|
3522
3533
|
handleDayChange(e, d); // update current day
|
|
3523
3534
|
|
|
3535
|
+
//
|
|
3536
|
+
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)).split('-');
|
|
3524
3537
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
3525
3538
|
id: 0,
|
|
3526
|
-
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
|
|
3539
|
+
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)),
|
|
3540
|
+
day: _now[2],
|
|
3541
|
+
month: _now[1],
|
|
3542
|
+
year: _now[0]
|
|
3527
3543
|
});
|
|
3528
3544
|
if (EVENTS_DELETE_ENABLED) {
|
|
3529
3545
|
onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_existsContent, function () {
|
|
@@ -3592,9 +3608,14 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3592
3608
|
if (isInteractive) {
|
|
3593
3609
|
handleDayChange(e, d); // update current day
|
|
3594
3610
|
|
|
3611
|
+
//
|
|
3612
|
+
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)).split('-');
|
|
3595
3613
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
3596
3614
|
id: 0,
|
|
3597
|
-
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
|
|
3615
|
+
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)),
|
|
3616
|
+
day: _now[2],
|
|
3617
|
+
month: _now[1],
|
|
3618
|
+
year: _now[0]
|
|
3598
3619
|
});
|
|
3599
3620
|
if (EVENTS_ENABLED) {
|
|
3600
3621
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen({
|
|
@@ -3865,6 +3865,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3865
3865
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3866
3866
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
3867
3867
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3868
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3869
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3870
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3871
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
3872
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3868
3873
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3869
3874
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3870
3875
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -4126,6 +4131,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4126
4131
|
prev: function prev() {
|
|
4127
4132
|
handlePrevChange();
|
|
4128
4133
|
},
|
|
4134
|
+
bodyScrollbarInit: function bodyScrollbarInit() {
|
|
4135
|
+
_bodyScrollbarInit();
|
|
4136
|
+
},
|
|
4129
4137
|
gridInit: function gridInit() {
|
|
4130
4138
|
tableGridInit();
|
|
4131
4139
|
},
|
|
@@ -4800,7 +4808,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4800
4808
|
// ================================================================
|
|
4801
4809
|
// Calendar
|
|
4802
4810
|
// ================================================================
|
|
4803
|
-
function
|
|
4811
|
+
function updateTodayDate(inputDate) {
|
|
4804
4812
|
setDay(inputDate.getDate());
|
|
4805
4813
|
setMonth(inputDate.getMonth());
|
|
4806
4814
|
setYear(inputDate.getFullYear());
|
|
@@ -4809,10 +4817,12 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4809
4817
|
// update selector
|
|
4810
4818
|
setSelectedMonth(inputDate.getMonth());
|
|
4811
4819
|
setSelectedYear(inputDate.getFullYear());
|
|
4812
|
-
|
|
4813
|
-
// initialize table grid
|
|
4814
4820
|
setTimeout(function () {
|
|
4821
|
+
// initialize table grid
|
|
4815
4822
|
tableGridInit();
|
|
4823
|
+
|
|
4824
|
+
// The scrollbar position is horizontal
|
|
4825
|
+
_bodyScrollbarInit();
|
|
4816
4826
|
}, 500);
|
|
4817
4827
|
}
|
|
4818
4828
|
function getStartDayOfMonth(date) {
|
|
@@ -4924,7 +4934,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4924
4934
|
function handleTodayChange() {
|
|
4925
4935
|
setSelectedMonth(now.getMonth());
|
|
4926
4936
|
setSelectedYear(now.getFullYear());
|
|
4927
|
-
|
|
4937
|
+
updateTodayDate(now);
|
|
4928
4938
|
|
|
4929
4939
|
//
|
|
4930
4940
|
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getTodayDate)().split('-');
|
|
@@ -4941,16 +4951,6 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4941
4951
|
|
|
4942
4952
|
// restore table grid init status
|
|
4943
4953
|
restoreTableGridInitStatus();
|
|
4944
|
-
|
|
4945
|
-
// The scrollbar position is horizontal
|
|
4946
|
-
setTimeout(function () {
|
|
4947
|
-
if (scrollBodyRef.current && tableGridRef.current) {
|
|
4948
|
-
var targetPos = tableGridRef.current.querySelector('.custom-event-tl-table__datagrid-header__content tbody .today.selected');
|
|
4949
|
-
if (targetPos !== null) {
|
|
4950
|
-
scrollBodyRef.current.scrollLeft = targetPos.offsetLeft;
|
|
4951
|
-
}
|
|
4952
|
-
}
|
|
4953
|
-
}, 0);
|
|
4954
4954
|
}
|
|
4955
4955
|
function handleAppearanceChange(e) {
|
|
4956
4956
|
var _mode = e.target.dataset.mode;
|
|
@@ -5070,10 +5070,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5070
5070
|
if (isInteractive) {
|
|
5071
5071
|
handleDayChange(e, d); // update current day
|
|
5072
5072
|
|
|
5073
|
+
//
|
|
5074
|
+
var _now = _dateShow.split('-');
|
|
5073
5075
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _currentData.length === 0 ? {
|
|
5074
5076
|
rowData: listSectionData,
|
|
5075
5077
|
id: 0,
|
|
5076
|
-
date: _dateShow
|
|
5078
|
+
date: _dateShow,
|
|
5079
|
+
day: _now[2],
|
|
5080
|
+
month: _now[1],
|
|
5081
|
+
year: _now[0]
|
|
5077
5082
|
} : _currentData[0]);
|
|
5078
5083
|
if (EVENTS_ENABLED) {
|
|
5079
5084
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(_currentData.length === 0 ? {
|
|
@@ -5174,7 +5179,13 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5174
5179
|
if (isInteractive) {
|
|
5175
5180
|
handleDayChange(e, d); // update current day
|
|
5176
5181
|
|
|
5177
|
-
|
|
5182
|
+
//
|
|
5183
|
+
var _now = cellItem.date.split('-');
|
|
5184
|
+
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _objectSpread(_objectSpread({}, cellItem), {}, {
|
|
5185
|
+
day: _now[2],
|
|
5186
|
+
month: _now[1],
|
|
5187
|
+
year: _now[0]
|
|
5188
|
+
}));
|
|
5178
5189
|
if (EVENTS_ENABLED) {
|
|
5179
5190
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(cellItem, function () {
|
|
5180
5191
|
return setShowEdit(true);
|
|
@@ -5219,10 +5230,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5219
5230
|
if (isInteractive) {
|
|
5220
5231
|
handleDayChange(e, d); // update current day
|
|
5221
5232
|
|
|
5233
|
+
//
|
|
5234
|
+
var _now = _dateShow.split('-');
|
|
5222
5235
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
5223
5236
|
rowData: listSectionData,
|
|
5224
5237
|
id: 0,
|
|
5225
|
-
date: _dateShow
|
|
5238
|
+
date: _dateShow,
|
|
5239
|
+
day: _now[2],
|
|
5240
|
+
month: _now[1],
|
|
5241
|
+
year: _now[0]
|
|
5226
5242
|
});
|
|
5227
5243
|
if (EVENTS_DELETE_ENABLED) {
|
|
5228
5244
|
onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_existsContent, function () {
|
|
@@ -5327,10 +5343,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5327
5343
|
if (isInteractive) {
|
|
5328
5344
|
handleDayChange(e, d); // update current day
|
|
5329
5345
|
|
|
5346
|
+
//
|
|
5347
|
+
var _now = _dateShow.split('-');
|
|
5330
5348
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
5331
5349
|
rowData: listSectionData,
|
|
5332
5350
|
id: 0,
|
|
5333
|
-
date: _dateShow
|
|
5351
|
+
date: _dateShow,
|
|
5352
|
+
day: _now[2],
|
|
5353
|
+
month: _now[1],
|
|
5354
|
+
year: _now[0]
|
|
5334
5355
|
});
|
|
5335
5356
|
if (EVENTS_ENABLED) {
|
|
5336
5357
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen({
|
|
@@ -5444,6 +5465,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5444
5465
|
if (scrollListRef.current) scrollListRef.current.scrollTop = 0;
|
|
5445
5466
|
if (scrollBodyRef.current) scrollBodyRef.current.scrollLeft = 0;
|
|
5446
5467
|
}
|
|
5468
|
+
function _bodyScrollbarInit() {
|
|
5469
|
+
if (scrollBodyRef.current === null || tableGridRef.current === null) return;
|
|
5470
|
+
|
|
5471
|
+
// The scrollbar position is horizontal
|
|
5472
|
+
var targetPos = tableGridRef.current.querySelector('.custom-event-tl-table__datagrid-header__content tbody .today.selected');
|
|
5473
|
+
if (targetPos !== null) {
|
|
5474
|
+
scrollBodyRef.current.scrollLeft = targetPos.offsetLeft;
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5447
5477
|
function tableGridInitHeadertitle() {
|
|
5448
5478
|
//
|
|
5449
5479
|
if (tableGridRef.current === null) return;
|
|
@@ -5690,7 +5720,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5690
5720
|
setYearsCollection(years);
|
|
5691
5721
|
}, [selectedYear]);
|
|
5692
5722
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
5693
|
-
|
|
5723
|
+
updateTodayDate(date);
|
|
5694
5724
|
}, [date]);
|
|
5695
5725
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
5696
5726
|
// Guaranteed year change triggered by the front and rear buttons
|
|
@@ -5717,7 +5747,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5717
5747
|
// update current today
|
|
5718
5748
|
if (typeof customTodayDate !== 'undefined' && (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.isValidDate)(customTodayDate)) {
|
|
5719
5749
|
var _customNow = new Date(customTodayDate);
|
|
5720
|
-
|
|
5750
|
+
updateTodayDate(_customNow);
|
|
5721
5751
|
}
|
|
5722
5752
|
|
|
5723
5753
|
// Call a function when the list has been rendered completely
|
|
@@ -2867,6 +2867,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2867
2867
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2868
2868
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2869
2869
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2870
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2871
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2872
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2873
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
2874
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2870
2875
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2871
2876
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
2872
2877
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -3225,7 +3230,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3225
3230
|
})
|
|
3226
3231
|
};
|
|
3227
3232
|
};
|
|
3228
|
-
function
|
|
3233
|
+
function updateTodayDate(inputDate) {
|
|
3229
3234
|
setDay(inputDate.getDate());
|
|
3230
3235
|
setMonth(inputDate.getMonth());
|
|
3231
3236
|
setYear(inputDate.getFullYear());
|
|
@@ -3306,7 +3311,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3306
3311
|
function handleTodayChange() {
|
|
3307
3312
|
setSelectedMonth(now.getMonth());
|
|
3308
3313
|
setSelectedYear(now.getFullYear());
|
|
3309
|
-
|
|
3314
|
+
updateTodayDate(now);
|
|
3310
3315
|
|
|
3311
3316
|
//
|
|
3312
3317
|
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getTodayDate)().split('-');
|
|
@@ -3344,7 +3349,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3344
3349
|
});
|
|
3345
3350
|
}, [year]);
|
|
3346
3351
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
3347
|
-
|
|
3352
|
+
updateTodayDate(date);
|
|
3348
3353
|
}, [date]);
|
|
3349
3354
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
3350
3355
|
// update events value
|
|
@@ -3353,7 +3358,7 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3353
3358
|
// update current today
|
|
3354
3359
|
if (typeof customTodayDate === 'string' && customTodayDate !== '' && (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.isValidDate)(customTodayDate)) {
|
|
3355
3360
|
var _customNow = new Date(customTodayDate);
|
|
3356
|
-
|
|
3361
|
+
updateTodayDate(_customNow);
|
|
3357
3362
|
}
|
|
3358
3363
|
|
|
3359
3364
|
// Call a function when the list has been rendered completely
|
|
@@ -3486,7 +3491,13 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3486
3491
|
if (isInteractive) {
|
|
3487
3492
|
handleDayChange(e, d); // update current day
|
|
3488
3493
|
|
|
3489
|
-
|
|
3494
|
+
//
|
|
3495
|
+
var _now = cellItem.date.split('-');
|
|
3496
|
+
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _objectSpread(_objectSpread({}, cellItem), {}, {
|
|
3497
|
+
day: _now[2],
|
|
3498
|
+
month: _now[1],
|
|
3499
|
+
year: _now[0]
|
|
3500
|
+
}));
|
|
3490
3501
|
if (EVENTS_ENABLED) {
|
|
3491
3502
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(cellItem, function () {
|
|
3492
3503
|
return setShowEdit(true);
|
|
@@ -3521,9 +3532,14 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3521
3532
|
if (isInteractive) {
|
|
3522
3533
|
handleDayChange(e, d); // update current day
|
|
3523
3534
|
|
|
3535
|
+
//
|
|
3536
|
+
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)).split('-');
|
|
3524
3537
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
3525
3538
|
id: 0,
|
|
3526
|
-
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
|
|
3539
|
+
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)),
|
|
3540
|
+
day: _now[2],
|
|
3541
|
+
month: _now[1],
|
|
3542
|
+
year: _now[0]
|
|
3527
3543
|
});
|
|
3528
3544
|
if (EVENTS_DELETE_ENABLED) {
|
|
3529
3545
|
onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_existsContent, function () {
|
|
@@ -3592,9 +3608,14 @@ var EventCalendar = function EventCalendar(props) {
|
|
|
3592
3608
|
if (isInteractive) {
|
|
3593
3609
|
handleDayChange(e, d); // update current day
|
|
3594
3610
|
|
|
3611
|
+
//
|
|
3612
|
+
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)).split('-');
|
|
3595
3613
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
3596
3614
|
id: 0,
|
|
3597
|
-
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
|
|
3615
|
+
date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d)),
|
|
3616
|
+
day: _now[2],
|
|
3617
|
+
month: _now[1],
|
|
3618
|
+
year: _now[0]
|
|
3598
3619
|
});
|
|
3599
3620
|
if (EVENTS_ENABLED) {
|
|
3600
3621
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen({
|
|
@@ -3865,6 +3865,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3865
3865
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3866
3866
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
3867
3867
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3868
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3869
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3870
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3871
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
3872
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3868
3873
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3869
3874
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3870
3875
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -4126,6 +4131,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4126
4131
|
prev: function prev() {
|
|
4127
4132
|
handlePrevChange();
|
|
4128
4133
|
},
|
|
4134
|
+
bodyScrollbarInit: function bodyScrollbarInit() {
|
|
4135
|
+
_bodyScrollbarInit();
|
|
4136
|
+
},
|
|
4129
4137
|
gridInit: function gridInit() {
|
|
4130
4138
|
tableGridInit();
|
|
4131
4139
|
},
|
|
@@ -4800,7 +4808,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4800
4808
|
// ================================================================
|
|
4801
4809
|
// Calendar
|
|
4802
4810
|
// ================================================================
|
|
4803
|
-
function
|
|
4811
|
+
function updateTodayDate(inputDate) {
|
|
4804
4812
|
setDay(inputDate.getDate());
|
|
4805
4813
|
setMonth(inputDate.getMonth());
|
|
4806
4814
|
setYear(inputDate.getFullYear());
|
|
@@ -4809,10 +4817,12 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4809
4817
|
// update selector
|
|
4810
4818
|
setSelectedMonth(inputDate.getMonth());
|
|
4811
4819
|
setSelectedYear(inputDate.getFullYear());
|
|
4812
|
-
|
|
4813
|
-
// initialize table grid
|
|
4814
4820
|
setTimeout(function () {
|
|
4821
|
+
// initialize table grid
|
|
4815
4822
|
tableGridInit();
|
|
4823
|
+
|
|
4824
|
+
// The scrollbar position is horizontal
|
|
4825
|
+
_bodyScrollbarInit();
|
|
4816
4826
|
}, 500);
|
|
4817
4827
|
}
|
|
4818
4828
|
function getStartDayOfMonth(date) {
|
|
@@ -4924,7 +4934,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4924
4934
|
function handleTodayChange() {
|
|
4925
4935
|
setSelectedMonth(now.getMonth());
|
|
4926
4936
|
setSelectedYear(now.getFullYear());
|
|
4927
|
-
|
|
4937
|
+
updateTodayDate(now);
|
|
4928
4938
|
|
|
4929
4939
|
//
|
|
4930
4940
|
var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getTodayDate)().split('-');
|
|
@@ -4941,16 +4951,6 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
4941
4951
|
|
|
4942
4952
|
// restore table grid init status
|
|
4943
4953
|
restoreTableGridInitStatus();
|
|
4944
|
-
|
|
4945
|
-
// The scrollbar position is horizontal
|
|
4946
|
-
setTimeout(function () {
|
|
4947
|
-
if (scrollBodyRef.current && tableGridRef.current) {
|
|
4948
|
-
var targetPos = tableGridRef.current.querySelector('.custom-event-tl-table__datagrid-header__content tbody .today.selected');
|
|
4949
|
-
if (targetPos !== null) {
|
|
4950
|
-
scrollBodyRef.current.scrollLeft = targetPos.offsetLeft;
|
|
4951
|
-
}
|
|
4952
|
-
}
|
|
4953
|
-
}, 0);
|
|
4954
4954
|
}
|
|
4955
4955
|
function handleAppearanceChange(e) {
|
|
4956
4956
|
var _mode = e.target.dataset.mode;
|
|
@@ -5070,10 +5070,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5070
5070
|
if (isInteractive) {
|
|
5071
5071
|
handleDayChange(e, d); // update current day
|
|
5072
5072
|
|
|
5073
|
+
//
|
|
5074
|
+
var _now = _dateShow.split('-');
|
|
5073
5075
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _currentData.length === 0 ? {
|
|
5074
5076
|
rowData: listSectionData,
|
|
5075
5077
|
id: 0,
|
|
5076
|
-
date: _dateShow
|
|
5078
|
+
date: _dateShow,
|
|
5079
|
+
day: _now[2],
|
|
5080
|
+
month: _now[1],
|
|
5081
|
+
year: _now[0]
|
|
5077
5082
|
} : _currentData[0]);
|
|
5078
5083
|
if (EVENTS_ENABLED) {
|
|
5079
5084
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(_currentData.length === 0 ? {
|
|
@@ -5174,7 +5179,13 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5174
5179
|
if (isInteractive) {
|
|
5175
5180
|
handleDayChange(e, d); // update current day
|
|
5176
5181
|
|
|
5177
|
-
|
|
5182
|
+
//
|
|
5183
|
+
var _now = cellItem.date.split('-');
|
|
5184
|
+
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _objectSpread(_objectSpread({}, cellItem), {}, {
|
|
5185
|
+
day: _now[2],
|
|
5186
|
+
month: _now[1],
|
|
5187
|
+
year: _now[0]
|
|
5188
|
+
}));
|
|
5178
5189
|
if (EVENTS_ENABLED) {
|
|
5179
5190
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(cellItem, function () {
|
|
5180
5191
|
return setShowEdit(true);
|
|
@@ -5219,10 +5230,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5219
5230
|
if (isInteractive) {
|
|
5220
5231
|
handleDayChange(e, d); // update current day
|
|
5221
5232
|
|
|
5233
|
+
//
|
|
5234
|
+
var _now = _dateShow.split('-');
|
|
5222
5235
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
5223
5236
|
rowData: listSectionData,
|
|
5224
5237
|
id: 0,
|
|
5225
|
-
date: _dateShow
|
|
5238
|
+
date: _dateShow,
|
|
5239
|
+
day: _now[2],
|
|
5240
|
+
month: _now[1],
|
|
5241
|
+
year: _now[0]
|
|
5226
5242
|
});
|
|
5227
5243
|
if (EVENTS_DELETE_ENABLED) {
|
|
5228
5244
|
onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_existsContent, function () {
|
|
@@ -5327,10 +5343,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5327
5343
|
if (isInteractive) {
|
|
5328
5344
|
handleDayChange(e, d); // update current day
|
|
5329
5345
|
|
|
5346
|
+
//
|
|
5347
|
+
var _now = _dateShow.split('-');
|
|
5330
5348
|
onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
|
|
5331
5349
|
rowData: listSectionData,
|
|
5332
5350
|
id: 0,
|
|
5333
|
-
date: _dateShow
|
|
5351
|
+
date: _dateShow,
|
|
5352
|
+
day: _now[2],
|
|
5353
|
+
month: _now[1],
|
|
5354
|
+
year: _now[0]
|
|
5334
5355
|
});
|
|
5335
5356
|
if (EVENTS_ENABLED) {
|
|
5336
5357
|
onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen({
|
|
@@ -5444,6 +5465,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5444
5465
|
if (scrollListRef.current) scrollListRef.current.scrollTop = 0;
|
|
5445
5466
|
if (scrollBodyRef.current) scrollBodyRef.current.scrollLeft = 0;
|
|
5446
5467
|
}
|
|
5468
|
+
function _bodyScrollbarInit() {
|
|
5469
|
+
if (scrollBodyRef.current === null || tableGridRef.current === null) return;
|
|
5470
|
+
|
|
5471
|
+
// The scrollbar position is horizontal
|
|
5472
|
+
var targetPos = tableGridRef.current.querySelector('.custom-event-tl-table__datagrid-header__content tbody .today.selected');
|
|
5473
|
+
if (targetPos !== null) {
|
|
5474
|
+
scrollBodyRef.current.scrollLeft = targetPos.offsetLeft;
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5447
5477
|
function tableGridInitHeadertitle() {
|
|
5448
5478
|
//
|
|
5449
5479
|
if (tableGridRef.current === null) return;
|
|
@@ -5690,7 +5720,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5690
5720
|
setYearsCollection(years);
|
|
5691
5721
|
}, [selectedYear]);
|
|
5692
5722
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
5693
|
-
|
|
5723
|
+
updateTodayDate(date);
|
|
5694
5724
|
}, [date]);
|
|
5695
5725
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
5696
5726
|
// Guaranteed year change triggered by the front and rear buttons
|
|
@@ -5717,7 +5747,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
|
|
|
5717
5747
|
// update current today
|
|
5718
5748
|
if (typeof customTodayDate !== 'undefined' && (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.isValidDate)(customTodayDate)) {
|
|
5719
5749
|
var _customNow = new Date(customTodayDate);
|
|
5720
|
-
|
|
5750
|
+
updateTodayDate(_customNow);
|
|
5721
5751
|
}
|
|
5722
5752
|
|
|
5723
5753
|
// Call a function when the list has been rendered completely
|
|
@@ -389,7 +389,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
389
389
|
};
|
|
390
390
|
|
|
391
391
|
|
|
392
|
-
function
|
|
392
|
+
function updateTodayDate(inputDate: Date) {
|
|
393
393
|
setDay(inputDate.getDate());
|
|
394
394
|
setMonth(inputDate.getMonth());
|
|
395
395
|
setYear(inputDate.getFullYear());
|
|
@@ -493,7 +493,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
493
493
|
function handleTodayChange() {
|
|
494
494
|
setSelectedMonth(now.getMonth());
|
|
495
495
|
setSelectedYear(now.getFullYear());
|
|
496
|
-
|
|
496
|
+
updateTodayDate(now);
|
|
497
497
|
|
|
498
498
|
//
|
|
499
499
|
const _now = getTodayDate().split('-');
|
|
@@ -538,7 +538,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
538
538
|
|
|
539
539
|
|
|
540
540
|
useEffect(() => {
|
|
541
|
-
|
|
541
|
+
updateTodayDate(date);
|
|
542
542
|
}, [date]);
|
|
543
543
|
|
|
544
544
|
|
|
@@ -550,7 +550,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
550
550
|
// update current today
|
|
551
551
|
if (typeof customTodayDate === 'string' && customTodayDate !== '' && isValidDate(customTodayDate)) {
|
|
552
552
|
const _customNow = new Date(customTodayDate);
|
|
553
|
-
|
|
553
|
+
updateTodayDate(_customNow);
|
|
554
554
|
}
|
|
555
555
|
|
|
556
556
|
// Call a function when the list has been rendered completely
|
|
@@ -684,7 +684,14 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
684
684
|
if (isInteractive) {
|
|
685
685
|
handleDayChange(e, d); // update current day
|
|
686
686
|
|
|
687
|
-
|
|
687
|
+
//
|
|
688
|
+
const _now = cellItem.date.split('-');
|
|
689
|
+
onChangeDate?.(e, {
|
|
690
|
+
...cellItem,
|
|
691
|
+
day: _now[2],
|
|
692
|
+
month: _now[1],
|
|
693
|
+
year: _now[0]
|
|
694
|
+
});
|
|
688
695
|
|
|
689
696
|
if (EVENTS_ENABLED) {
|
|
690
697
|
onModalEditOpen?.(cellItem, () => setShowEdit(true), 'normal');
|
|
@@ -730,9 +737,15 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
730
737
|
if (isInteractive) {
|
|
731
738
|
handleDayChange(e, d); // update current day
|
|
732
739
|
|
|
740
|
+
|
|
741
|
+
//
|
|
742
|
+
const _now = getCalendarDate(`${year}-${month + 1}-${d}`).split('-');
|
|
733
743
|
onChangeDate?.(e, {
|
|
734
744
|
id: 0,
|
|
735
|
-
date: getCalendarDate(`${year}-${month + 1}-${d}`)
|
|
745
|
+
date: getCalendarDate(`${year}-${month + 1}-${d}`),
|
|
746
|
+
day: _now[2],
|
|
747
|
+
month: _now[1],
|
|
748
|
+
year: _now[0]
|
|
736
749
|
});
|
|
737
750
|
|
|
738
751
|
if (EVENTS_DELETE_ENABLED) {
|
|
@@ -831,9 +844,15 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
831
844
|
if (isInteractive) {
|
|
832
845
|
handleDayChange(e, d); // update current day
|
|
833
846
|
|
|
847
|
+
|
|
848
|
+
//
|
|
849
|
+
const _now = getCalendarDate(`${year}-${month + 1}-${d}`).split('-');
|
|
834
850
|
onChangeDate?.(e, {
|
|
835
851
|
id: 0,
|
|
836
|
-
date: getCalendarDate(`${year}-${month + 1}-${d}`)
|
|
852
|
+
date: getCalendarDate(`${year}-${month + 1}-${d}`),
|
|
853
|
+
day: _now[2],
|
|
854
|
+
month: _now[1],
|
|
855
|
+
year: _now[0]
|
|
837
856
|
});
|
|
838
857
|
|
|
839
858
|
if (EVENTS_ENABLED) {
|
|
@@ -331,6 +331,9 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
331
331
|
prev: () => {
|
|
332
332
|
handlePrevChange();
|
|
333
333
|
},
|
|
334
|
+
bodyScrollbarInit: () => {
|
|
335
|
+
bodyScrollbarInit();
|
|
336
|
+
},
|
|
334
337
|
gridInit: () => {
|
|
335
338
|
tableGridInit();
|
|
336
339
|
},
|
|
@@ -1000,7 +1003,7 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1000
1003
|
// ================================================================
|
|
1001
1004
|
// Calendar
|
|
1002
1005
|
// ================================================================
|
|
1003
|
-
function
|
|
1006
|
+
function updateTodayDate(inputDate: Date) {
|
|
1004
1007
|
setDay(inputDate.getDate());
|
|
1005
1008
|
setMonth(inputDate.getMonth());
|
|
1006
1009
|
setYear(inputDate.getFullYear());
|
|
@@ -1010,11 +1013,14 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1010
1013
|
setSelectedMonth(inputDate.getMonth());
|
|
1011
1014
|
setSelectedYear(inputDate.getFullYear());
|
|
1012
1015
|
|
|
1013
|
-
|
|
1016
|
+
|
|
1014
1017
|
setTimeout(() => {
|
|
1018
|
+
// initialize table grid
|
|
1015
1019
|
tableGridInit();
|
|
1016
|
-
}, 500);
|
|
1017
1020
|
|
|
1021
|
+
// The scrollbar position is horizontal
|
|
1022
|
+
bodyScrollbarInit();
|
|
1023
|
+
}, 500);
|
|
1018
1024
|
|
|
1019
1025
|
}
|
|
1020
1026
|
|
|
@@ -1157,7 +1163,7 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1157
1163
|
function handleTodayChange() {
|
|
1158
1164
|
setSelectedMonth(now.getMonth());
|
|
1159
1165
|
setSelectedYear(now.getFullYear());
|
|
1160
|
-
|
|
1166
|
+
updateTodayDate(now);
|
|
1161
1167
|
|
|
1162
1168
|
//
|
|
1163
1169
|
const _now = getTodayDate().split('-');
|
|
@@ -1176,18 +1182,6 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1176
1182
|
// restore table grid init status
|
|
1177
1183
|
restoreTableGridInitStatus();
|
|
1178
1184
|
|
|
1179
|
-
// The scrollbar position is horizontal
|
|
1180
|
-
setTimeout(() => {
|
|
1181
|
-
if (scrollBodyRef.current && tableGridRef.current) {
|
|
1182
|
-
const targetPos = tableGridRef.current.querySelector('.custom-event-tl-table__datagrid-header__content tbody .today.selected');
|
|
1183
|
-
if (targetPos !== null) {
|
|
1184
|
-
(scrollBodyRef.current as any).scrollLeft = targetPos.offsetLeft;
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
}, 0);
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
1185
|
}
|
|
1192
1186
|
|
|
1193
1187
|
function handleAppearanceChange(e: React.MouseEvent) {
|
|
@@ -1312,10 +1306,15 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1312
1306
|
if (isInteractive) {
|
|
1313
1307
|
handleDayChange(e, d); // update current day
|
|
1314
1308
|
|
|
1309
|
+
//
|
|
1310
|
+
const _now = _dateShow.split('-');
|
|
1315
1311
|
onChangeDate?.(e, _currentData.length === 0 ? {
|
|
1316
1312
|
rowData: listSectionData,
|
|
1317
1313
|
id: 0,
|
|
1318
|
-
date: _dateShow
|
|
1314
|
+
date: _dateShow,
|
|
1315
|
+
day: _now[2],
|
|
1316
|
+
month: _now[1],
|
|
1317
|
+
year: _now[0]
|
|
1319
1318
|
} : _currentData[0]);
|
|
1320
1319
|
|
|
1321
1320
|
if (EVENTS_ENABLED) {
|
|
@@ -1452,8 +1451,14 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1452
1451
|
if (isInteractive) {
|
|
1453
1452
|
handleDayChange(e, d); // update current day
|
|
1454
1453
|
|
|
1455
|
-
|
|
1456
|
-
|
|
1454
|
+
//
|
|
1455
|
+
const _now = cellItem.date.split('-');
|
|
1456
|
+
onChangeDate?.(e, {
|
|
1457
|
+
...cellItem,
|
|
1458
|
+
day: _now[2],
|
|
1459
|
+
month: _now[1],
|
|
1460
|
+
year: _now[0]
|
|
1461
|
+
});
|
|
1457
1462
|
|
|
1458
1463
|
if (EVENTS_ENABLED) {
|
|
1459
1464
|
onModalEditOpen?.(cellItem, () => setShowEdit(true), 'normal');
|
|
@@ -1511,10 +1516,15 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1511
1516
|
if (isInteractive) {
|
|
1512
1517
|
handleDayChange(e, d); // update current day
|
|
1513
1518
|
|
|
1519
|
+
//
|
|
1520
|
+
const _now = _dateShow.split('-');
|
|
1514
1521
|
onChangeDate?.(e, {
|
|
1515
1522
|
rowData: listSectionData,
|
|
1516
1523
|
id: 0,
|
|
1517
|
-
date: _dateShow
|
|
1524
|
+
date: _dateShow,
|
|
1525
|
+
day: _now[2],
|
|
1526
|
+
month: _now[1],
|
|
1527
|
+
year: _now[0]
|
|
1518
1528
|
});
|
|
1519
1529
|
|
|
1520
1530
|
if (EVENTS_DELETE_ENABLED) {
|
|
@@ -1645,10 +1655,15 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1645
1655
|
if (isInteractive) {
|
|
1646
1656
|
handleDayChange(e, d); // update current day
|
|
1647
1657
|
|
|
1658
|
+
//
|
|
1659
|
+
const _now = _dateShow.split('-');
|
|
1648
1660
|
onChangeDate?.(e, {
|
|
1649
1661
|
rowData: listSectionData,
|
|
1650
1662
|
id: 0,
|
|
1651
|
-
date: _dateShow
|
|
1663
|
+
date: _dateShow,
|
|
1664
|
+
day: _now[2],
|
|
1665
|
+
month: _now[1],
|
|
1666
|
+
year: _now[0]
|
|
1652
1667
|
});
|
|
1653
1668
|
|
|
1654
1669
|
if (EVENTS_ENABLED) {
|
|
@@ -1818,6 +1833,19 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
1818
1833
|
}
|
|
1819
1834
|
|
|
1820
1835
|
|
|
1836
|
+
function bodyScrollbarInit() {
|
|
1837
|
+
if (scrollBodyRef.current === null || tableGridRef.current === null) return;
|
|
1838
|
+
|
|
1839
|
+
// The scrollbar position is horizontal
|
|
1840
|
+
const targetPos = tableGridRef.current.querySelector('.custom-event-tl-table__datagrid-header__content tbody .today.selected');
|
|
1841
|
+
if (targetPos !== null) {
|
|
1842
|
+
(scrollBodyRef.current as any).scrollLeft = targetPos.offsetLeft;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
|
|
1821
1849
|
function tableGridInitHeadertitle() {
|
|
1822
1850
|
//
|
|
1823
1851
|
if (tableGridRef.current === null) return;
|
|
@@ -2124,7 +2152,7 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
2124
2152
|
|
|
2125
2153
|
|
|
2126
2154
|
useEffect(() => {
|
|
2127
|
-
|
|
2155
|
+
updateTodayDate(date);
|
|
2128
2156
|
}, [date]);
|
|
2129
2157
|
|
|
2130
2158
|
|
|
@@ -2157,7 +2185,7 @@ const EventCalendarTimeline = (props: EventCalendarTimelineProps) => {
|
|
|
2157
2185
|
// update current today
|
|
2158
2186
|
if (typeof customTodayDate !== 'undefined' && isValidDate(customTodayDate)) {
|
|
2159
2187
|
const _customNow = new Date(customTodayDate);
|
|
2160
|
-
|
|
2188
|
+
updateTodayDate(_customNow);
|
|
2161
2189
|
}
|
|
2162
2190
|
|
|
2163
2191
|
// Call a function when the list has been rendered completely
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "UIUX Lab",
|
|
3
3
|
"email": "uiuxlab@gmail.com",
|
|
4
4
|
"name": "funda-ui",
|
|
5
|
-
"version": "4.5.
|
|
5
|
+
"version": "4.5.585",
|
|
6
6
|
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|