funda-ui 4.5.522 → 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.
@@ -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); }
@@ -3990,10 +3995,6 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3990
3995
  //
3991
3996
  var FILL_BLANK_DATE_DISABLD = typeof forwardAndBackFillDisabled === 'undefined' ? true : forwardAndBackFillDisabled;
3992
3997
 
3993
- // root
3994
- var rootRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
3995
- var rootWidth = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0);
3996
-
3997
3998
  //
3998
3999
  var now = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
3999
4000
  return new Date();
@@ -4121,6 +4122,18 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4121
4122
  // exposes the following methods
4122
4123
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(contentRef, function () {
4123
4124
  return {
4125
+ today: function today() {
4126
+ handleTodayChange();
4127
+ },
4128
+ next: function next() {
4129
+ handleNextChange();
4130
+ },
4131
+ prev: function prev() {
4132
+ handlePrevChange();
4133
+ },
4134
+ bodyScrollbarInit: function bodyScrollbarInit() {
4135
+ _bodyScrollbarInit();
4136
+ },
4124
4137
  gridInit: function gridInit() {
4125
4138
  tableGridInit();
4126
4139
  },
@@ -4795,7 +4808,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4795
4808
  // ================================================================
4796
4809
  // Calendar
4797
4810
  // ================================================================
4798
- function setTodayDate(inputDate) {
4811
+ function updateTodayDate(inputDate) {
4799
4812
  setDay(inputDate.getDate());
4800
4813
  setMonth(inputDate.getMonth());
4801
4814
  setYear(inputDate.getFullYear());
@@ -4804,10 +4817,12 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4804
4817
  // update selector
4805
4818
  setSelectedMonth(inputDate.getMonth());
4806
4819
  setSelectedYear(inputDate.getFullYear());
4807
-
4808
- // initialize table grid
4809
4820
  setTimeout(function () {
4821
+ // initialize table grid
4810
4822
  tableGridInit();
4823
+
4824
+ // The scrollbar position is horizontal
4825
+ _bodyScrollbarInit();
4811
4826
  }, 500);
4812
4827
  }
4813
4828
  function getStartDayOfMonth(date) {
@@ -4919,7 +4934,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4919
4934
  function handleTodayChange() {
4920
4935
  setSelectedMonth(now.getMonth());
4921
4936
  setSelectedYear(now.getFullYear());
4922
- setTodayDate(now);
4937
+ updateTodayDate(now);
4923
4938
 
4924
4939
  //
4925
4940
  var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getTodayDate)().split('-');
@@ -5021,7 +5036,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5021
5036
  className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)('custom-event-tl-table__cell-cushion-headercontent__container', {
5022
5037
  'empty': !isInteractive,
5023
5038
  'today': d === now.getDate(),
5024
- 'selected': d === day,
5039
+ 'selected': "".concat(year, "-").concat((0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(month + 1), "-").concat((0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(day)) === "".concat(year, "-").concat((0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(month + 1), "-").concat((0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(d)),
5025
5040
  'last-cell': isLastCol
5026
5041
  }),
5027
5042
  key: "col" + i,
@@ -5055,10 +5070,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5055
5070
  if (isInteractive) {
5056
5071
  handleDayChange(e, d); // update current day
5057
5072
 
5073
+ //
5074
+ var _now = _dateShow.split('-');
5058
5075
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _currentData.length === 0 ? {
5059
5076
  rowData: listSectionData,
5060
5077
  id: 0,
5061
- date: _dateShow
5078
+ date: _dateShow,
5079
+ day: _now[2],
5080
+ month: _now[1],
5081
+ year: _now[0]
5062
5082
  } : _currentData[0]);
5063
5083
  if (EVENTS_ENABLED) {
5064
5084
  onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(_currentData.length === 0 ? {
@@ -5159,7 +5179,13 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5159
5179
  if (isInteractive) {
5160
5180
  handleDayChange(e, d); // update current day
5161
5181
 
5162
- onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, cellItem);
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
+ }));
5163
5189
  if (EVENTS_ENABLED) {
5164
5190
  onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(cellItem, function () {
5165
5191
  return setShowEdit(true);
@@ -5204,10 +5230,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5204
5230
  if (isInteractive) {
5205
5231
  handleDayChange(e, d); // update current day
5206
5232
 
5233
+ //
5234
+ var _now = _dateShow.split('-');
5207
5235
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
5208
5236
  rowData: listSectionData,
5209
5237
  id: 0,
5210
- date: _dateShow
5238
+ date: _dateShow,
5239
+ day: _now[2],
5240
+ month: _now[1],
5241
+ year: _now[0]
5211
5242
  });
5212
5243
  if (EVENTS_DELETE_ENABLED) {
5213
5244
  onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_existsContent, function () {
@@ -5312,10 +5343,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5312
5343
  if (isInteractive) {
5313
5344
  handleDayChange(e, d); // update current day
5314
5345
 
5346
+ //
5347
+ var _now = _dateShow.split('-');
5315
5348
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
5316
5349
  rowData: listSectionData,
5317
5350
  id: 0,
5318
- date: _dateShow
5351
+ date: _dateShow,
5352
+ day: _now[2],
5353
+ month: _now[1],
5354
+ year: _now[0]
5319
5355
  });
5320
5356
  if (EVENTS_ENABLED) {
5321
5357
  onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen({
@@ -5429,6 +5465,15 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5429
5465
  if (scrollListRef.current) scrollListRef.current.scrollTop = 0;
5430
5466
  if (scrollBodyRef.current) scrollBodyRef.current.scrollLeft = 0;
5431
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
+ }
5432
5477
  function tableGridInitHeadertitle() {
5433
5478
  //
5434
5479
  if (tableGridRef.current === null) return;
@@ -5444,28 +5489,6 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5444
5489
  trElements[i].style.height = tdOHeight;
5445
5490
  }
5446
5491
  }
5447
- function outerWrapperInit() {
5448
- var _rootRef$current$pare;
5449
- if (rootRef.current === null) return;
5450
- var hasInlineHeightOrMaxHeight = function hasInlineHeightOrMaxHeight(element) {
5451
- if (!element) return false;
5452
- return element.style.height !== '' || element.style.maxHeight !== '';
5453
- };
5454
-
5455
- // calculate wrapper width & height
5456
- var wrapperWidth = ((_rootRef$current$pare = rootRef.current.parentElement) === null || _rootRef$current$pare === void 0 ? void 0 : _rootRef$current$pare.offsetWidth) || 0;
5457
- if (rootRef.current && wrapperWidth > 0 && rootWidth.current === 0) {
5458
- var _rootRef$current$pare2;
5459
- rootWidth.current = wrapperWidth;
5460
- rootRef.current.style.width = wrapperWidth + 'px';
5461
-
5462
- // height
5463
- var wrapperHeight = ((_rootRef$current$pare2 = rootRef.current.parentElement) === null || _rootRef$current$pare2 === void 0 ? void 0 : _rootRef$current$pare2.offsetHeight) || 0;
5464
- if (hasInlineHeightOrMaxHeight(rootRef.current.parentElement) && wrapperHeight > 0) {
5465
- rootRef.current.style.height = wrapperHeight + 'px';
5466
- }
5467
- }
5468
- }
5469
5492
  function tableGridInit() {
5470
5493
  //
5471
5494
  if (tableGridRef.current === null) return;
@@ -5697,7 +5720,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5697
5720
  setYearsCollection(years);
5698
5721
  }, [selectedYear]);
5699
5722
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
5700
- setTodayDate(date);
5723
+ updateTodayDate(date);
5701
5724
  }, [date]);
5702
5725
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
5703
5726
  // Guaranteed year change triggered by the front and rear buttons
@@ -5724,17 +5747,13 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5724
5747
  // update current today
5725
5748
  if (typeof customTodayDate !== 'undefined' && (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.isValidDate)(customTodayDate)) {
5726
5749
  var _customNow = new Date(customTodayDate);
5727
- setTodayDate(_customNow);
5750
+ updateTodayDate(_customNow);
5728
5751
  }
5729
5752
 
5730
5753
  // Call a function when the list has been rendered completely
5731
5754
  onListRenderComplete === null || onListRenderComplete === void 0 ? void 0 : onListRenderComplete();
5732
5755
  }, [eventsValue, customTodayDate, appearanceMode]);
5733
5756
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
5734
- // calculate wrapper width (!!!FIRST!!!)
5735
- //--------------
5736
- outerWrapperInit();
5737
-
5738
5757
  // !!!Please do not use dependencies
5739
5758
  //--------------
5740
5759
  return function () {
@@ -5747,9 +5766,6 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5747
5766
  };
5748
5767
  }, []);
5749
5768
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
5750
- ref: rootRef,
5751
- className: "custom-event-tl__outerwrapper"
5752
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
5753
5769
  className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)("custom-event-tl__wrapper custom-event-tl__wrapper--".concat(appearanceMode), calendarWrapperClassName)
5754
5770
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
5755
5771
  className: "custom-event-tl__header bg-body-tertiary"
@@ -5961,7 +5977,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5961
5977
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", {
5962
5978
  key: i
5963
5979
  }, generateDaysUi(item.eventSources, item.listSection, i, true));
5964
- }))))))))))))), EVENTS_ENABLED ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_modaldialog__WEBPACK_IMPORTED_MODULE_2___default()), {
5980
+ })))))))))))), EVENTS_ENABLED ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_modaldialog__WEBPACK_IMPORTED_MODULE_2___default()), {
5965
5981
  ref: modalDeleteHandleRef,
5966
5982
  show: showDelete,
5967
5983
  maskOpacity: modalMaskOpacity,
@@ -476,6 +476,17 @@ var MasonryLayout = function MasonryLayout(props) {
476
476
 
477
477
  // STEP 3:
478
478
  //=================
479
+ // Calculate the wrapper width based on the gap
480
+ var wrapperTotalGap = 0;
481
+ for (var _i2 = 0; _i2 < colCount; _i2++) {
482
+ if (_i2 > 0) {
483
+ wrapperTotalGap += GAP;
484
+ }
485
+ }
486
+ if (rootRef.current) rootRef.current.style.width = "calc(100% - ".concat(wrapperTotalGap, "px)");
487
+
488
+ // STEP 4:
489
+ //=================
479
490
  // Divide the children into columns
480
491
  var items = [];
481
492
  if (children && !Array.isArray(children)) {
@@ -493,32 +504,31 @@ var MasonryLayout = function MasonryLayout(props) {
493
504
  var columnIndex = i % colCount;
494
505
  columnWrapper["".concat(itemWrapperKey).concat(columnIndex)].push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
495
506
  key: i,
496
- className: "masonry-item",
497
507
  style: {
498
508
  marginBottom: "".concat(GAP, "px")
499
509
  }
500
510
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
501
511
  style: perBrickWidth > 0 ? {
502
- maxWidth: perBrickWidth + 'px'
512
+ width: perBrickWidth + 'px'
503
513
  } : undefined
504
514
  }, el)));
505
515
  });
506
516
 
507
- // STEP 4:
517
+ // STEP 5:
508
518
  //=================
509
519
  // Wrapping the items in each column with a div and pushing it into the result array
510
- for (var _i2 = 0; _i2 < colCount; _i2++) {
520
+ for (var _i3 = 0; _i3 < colCount; _i3++) {
511
521
  result.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
512
- key: _i2,
522
+ key: _i3,
513
523
  className: "masonry-item",
514
524
  style: {
515
- marginLeft: "".concat(_i2 > 0 ? GAP : 0, "px"),
516
- flex: 1
525
+ marginLeft: "".concat(_i3 > 0 ? GAP : 0, "px"),
526
+ flex: '0 1 auto'
517
527
  }
518
- }, columnWrapper["".concat(itemWrapperKey).concat(_i2)]));
528
+ }, columnWrapper["".concat(itemWrapperKey).concat(_i3)]));
519
529
  }
520
530
 
521
- // STEP 5:
531
+ // STEP 6:
522
532
  //=================
523
533
  setItems(result);
524
534
  }, [children]);
@@ -187,6 +187,15 @@ const EventCalendar = (props: EventCalendarProps) => {
187
187
  useImperativeHandle(
188
188
  contentRef,
189
189
  () => ({
190
+ today: () => {
191
+ handleTodayChange();
192
+ },
193
+ next: () => {
194
+ handleNextChange();
195
+ },
196
+ prev: () => {
197
+ handlePrevChange();
198
+ },
190
199
  closeModal: () => {
191
200
  if (modalEditHandleRef.current) modalEditHandleRef.current.close();
192
201
  if (modalDeleteHandleRef.current) modalDeleteHandleRef.current.close();
@@ -380,7 +389,7 @@ const EventCalendar = (props: EventCalendarProps) => {
380
389
  };
381
390
 
382
391
 
383
- function setTodayDate(inputDate: Date) {
392
+ function updateTodayDate(inputDate: Date) {
384
393
  setDay(inputDate.getDate());
385
394
  setMonth(inputDate.getMonth());
386
395
  setYear(inputDate.getFullYear());
@@ -484,7 +493,7 @@ const EventCalendar = (props: EventCalendarProps) => {
484
493
  function handleTodayChange() {
485
494
  setSelectedMonth(now.getMonth());
486
495
  setSelectedYear(now.getFullYear());
487
- setTodayDate(now);
496
+ updateTodayDate(now);
488
497
 
489
498
  //
490
499
  const _now = getTodayDate().split('-');
@@ -529,7 +538,7 @@ const EventCalendar = (props: EventCalendarProps) => {
529
538
 
530
539
 
531
540
  useEffect(() => {
532
- setTodayDate(date);
541
+ updateTodayDate(date);
533
542
  }, [date]);
534
543
 
535
544
 
@@ -541,7 +550,7 @@ const EventCalendar = (props: EventCalendarProps) => {
541
550
  // update current today
542
551
  if (typeof customTodayDate === 'string' && customTodayDate !== '' && isValidDate(customTodayDate)) {
543
552
  const _customNow = new Date(customTodayDate);
544
- setTodayDate(_customNow);
553
+ updateTodayDate(_customNow);
545
554
  }
546
555
 
547
556
  // Call a function when the list has been rendered completely
@@ -675,7 +684,14 @@ const EventCalendar = (props: EventCalendarProps) => {
675
684
  if (isInteractive) {
676
685
  handleDayChange(e, d); // update current day
677
686
 
678
- onChangeDate?.(e, cellItem);
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
+ });
679
695
 
680
696
  if (EVENTS_ENABLED) {
681
697
  onModalEditOpen?.(cellItem, () => setShowEdit(true), 'normal');
@@ -721,9 +737,15 @@ const EventCalendar = (props: EventCalendarProps) => {
721
737
  if (isInteractive) {
722
738
  handleDayChange(e, d); // update current day
723
739
 
740
+
741
+ //
742
+ const _now = getCalendarDate(`${year}-${month + 1}-${d}`).split('-');
724
743
  onChangeDate?.(e, {
725
744
  id: 0,
726
- 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]
727
749
  });
728
750
 
729
751
  if (EVENTS_DELETE_ENABLED) {
@@ -822,9 +844,15 @@ const EventCalendar = (props: EventCalendarProps) => {
822
844
  if (isInteractive) {
823
845
  handleDayChange(e, d); // update current day
824
846
 
847
+
848
+ //
849
+ const _now = getCalendarDate(`${year}-${month + 1}-${d}`).split('-');
825
850
  onChangeDate?.(e, {
826
851
  id: 0,
827
- 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]
828
856
  });
829
857
 
830
858
  if (EVENTS_ENABLED) {