funda-ui 4.3.555 → 4.4.15

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.
Files changed (63) hide show
  1. package/Date/index.js +104 -0
  2. package/EventCalendar/index.css +7 -0
  3. package/EventCalendar/index.d.ts +2 -0
  4. package/EventCalendar/index.js +228 -89
  5. package/EventCalendarTimeline/index.css +29 -1
  6. package/EventCalendarTimeline/index.d.ts +11 -1
  7. package/EventCalendarTimeline/index.js +796 -298
  8. package/MultipleSelect/index.js +1 -1
  9. package/NativeSelect/index.js +1 -1
  10. package/Select/index.css +17 -0
  11. package/Select/index.d.ts +1 -0
  12. package/Select/index.js +83 -38
  13. package/Table/index.d.ts +4 -4
  14. package/Table/index.js +17 -17
  15. package/Tree/index.js +1 -1
  16. package/Utils/date.d.ts +27 -1
  17. package/Utils/date.js +92 -0
  18. package/lib/cjs/Date/index.js +104 -0
  19. package/lib/cjs/EventCalendar/index.d.ts +2 -0
  20. package/lib/cjs/EventCalendar/index.js +228 -89
  21. package/lib/cjs/EventCalendarTimeline/index.d.ts +11 -1
  22. package/lib/cjs/EventCalendarTimeline/index.js +796 -298
  23. package/lib/cjs/MultipleSelect/index.js +1 -1
  24. package/lib/cjs/NativeSelect/index.js +1 -1
  25. package/lib/cjs/Select/index.d.ts +1 -0
  26. package/lib/cjs/Select/index.js +83 -38
  27. package/lib/cjs/Table/index.d.ts +4 -4
  28. package/lib/cjs/Table/index.js +17 -17
  29. package/lib/cjs/Tree/index.js +1 -1
  30. package/lib/cjs/Utils/date.d.ts +27 -1
  31. package/lib/cjs/Utils/date.js +92 -0
  32. package/lib/css/EventCalendar/index.css +7 -0
  33. package/lib/css/EventCalendarTimeline/index.css +29 -1
  34. package/lib/css/Select/index.css +17 -0
  35. package/lib/esm/EventCalendar/index.scss +9 -0
  36. package/lib/esm/EventCalendar/index.tsx +203 -156
  37. package/lib/esm/EventCalendarTimeline/index.scss +46 -1
  38. package/lib/esm/EventCalendarTimeline/index.tsx +815 -358
  39. package/lib/esm/MultipleSelect/ItemList.tsx +1 -1
  40. package/lib/esm/MultipleSelect/index.tsx +1 -1
  41. package/lib/esm/NativeSelect/index.tsx +1 -1
  42. package/lib/esm/Select/index.scss +36 -1
  43. package/lib/esm/Select/index.tsx +179 -30
  44. package/lib/esm/Table/Table.tsx +2 -2
  45. package/lib/esm/Table/TableCell.tsx +2 -2
  46. package/lib/esm/Table/TableRow.tsx +1 -1
  47. package/lib/esm/Table/index.tsx +4 -4
  48. package/lib/esm/Tree/TreeList.tsx +1 -1
  49. package/lib/esm/Utils/libs/date.ts +101 -1
  50. package/package.json +1 -1
  51. /package/lib/esm/MultipleSelect/{multiple-select-utils → utils}/func.ts +0 -0
  52. /package/lib/esm/NativeSelect/{native-select-utils → utils}/func.ts +0 -0
  53. /package/lib/esm/Select/{select-utils → utils}/func.ts +0 -0
  54. /package/lib/esm/Table/{table-utils → utils}/DragHandleSprite.tsx +0 -0
  55. /package/lib/esm/Table/{table-utils → utils}/SortSprite.tsx +0 -0
  56. /package/lib/esm/Table/{table-utils → utils}/TableFilter.tsx +0 -0
  57. /package/lib/esm/Table/{table-utils → utils}/ToggleSelection.tsx +0 -0
  58. /package/lib/esm/Table/{table-utils → utils}/func.ts +0 -0
  59. /package/lib/esm/Table/{table-utils → utils}/hooks/useTableDraggable.tsx +0 -0
  60. /package/lib/esm/Table/{table-utils → utils}/hooks/useTableKeyPress.tsx +0 -0
  61. /package/lib/esm/Table/{table-utils → utils}/hooks/useTableResponsive.tsx +0 -0
  62. /package/lib/esm/Table/{table-utils → utils}/hooks/useTableSort.tsx +0 -0
  63. /package/lib/esm/Tree/{tree-utils.ts → utils/func.ts} +0 -0
@@ -2343,6 +2343,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2343
2343
  return (/* binding */_getCurrentYear
2344
2344
  );
2345
2345
  },
2346
+ /* harmony export */"getDateDetails": function getDateDetails() {
2347
+ return (/* binding */_getDateDetails
2348
+ );
2349
+ },
2346
2350
  /* harmony export */"getFirstAndLastMonthDay": function getFirstAndLastMonthDay() {
2347
2351
  return (/* binding */_getFirstAndLastMonthDay
2348
2352
  );
@@ -2355,6 +2359,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2355
2359
  return (/* binding */_getLastDayInMonth
2356
2360
  );
2357
2361
  },
2362
+ /* harmony export */"getMonthDates": function getMonthDates() {
2363
+ return (/* binding */_getMonthDates
2364
+ );
2365
+ },
2358
2366
  /* harmony export */"getNextMonthDate": function getNextMonthDate() {
2359
2367
  return (/* binding */_getNextMonthDate
2360
2368
  );
@@ -2387,6 +2395,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2387
2395
  return (/* binding */_getTomorrowDate
2388
2396
  );
2389
2397
  },
2398
+ /* harmony export */"getWeekDatesFromMon": function getWeekDatesFromMon() {
2399
+ return (/* binding */_getWeekDatesFromMon
2400
+ );
2401
+ },
2402
+ /* harmony export */"getWeekDatesFromSun": function getWeekDatesFromSun() {
2403
+ return (/* binding */_getWeekDatesFromSun
2404
+ );
2405
+ },
2390
2406
  /* harmony export */"getYesterdayDate": function getYesterdayDate() {
2391
2407
  return (/* binding */_getYesterdayDate
2392
2408
  );
@@ -2538,6 +2554,31 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2538
2554
  return date;
2539
2555
  }
2540
2556
 
2557
+ /**
2558
+ * Get date details
2559
+ * @param {Date | String} v
2560
+ * @param {Boolean} padZeroEnabled
2561
+ * @typedef {Object} JSON
2562
+ */
2563
+ function _getDateDetails(v) {
2564
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2565
+ var date = _dateFormat(v);
2566
+ var year = date.getFullYear();
2567
+ var month = _padZero(date.getMonth() + 1, padZeroEnabled);
2568
+ var day = _padZero(date.getDate(), padZeroEnabled);
2569
+ var hours = _padZero(date.getHours(), padZeroEnabled);
2570
+ var minutes = _padZero(date.getMinutes(), padZeroEnabled);
2571
+ var seconds = _padZero(date.getSeconds(), padZeroEnabled);
2572
+ return {
2573
+ year: String(year),
2574
+ month: month,
2575
+ day: day,
2576
+ hours: hours,
2577
+ minutes: minutes,
2578
+ seconds: seconds
2579
+ };
2580
+ }
2581
+
2541
2582
  /**
2542
2583
  * Get calendar date
2543
2584
  * @param {Date | String} v
@@ -2833,6 +2874,69 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2833
2874
  return _getFullTime(new Date(v), padZeroEnabled);
2834
2875
  }
2835
2876
 
2877
+ /**
2878
+ * Get the date of the specified month
2879
+ * @param {Number} year
2880
+ * @param {Number} month
2881
+ * @returns {Array<string>}
2882
+ */
2883
+ function _getMonthDates(year, month) {
2884
+ var dates = [];
2885
+
2886
+ // Get the total number of days in the month
2887
+ var daysInMonth = new Date(year, month, 0).getDate();
2888
+ for (var day = 1; day <= daysInMonth; day++) {
2889
+ dates.push("".concat(year, "-").concat(String(month).padStart(2, '0'), "-").concat(String(day).padStart(2, '0'))); // 'YYYY-MM-DD'
2890
+ }
2891
+
2892
+ return dates;
2893
+ }
2894
+
2895
+ /**
2896
+ * Get the date of the specified week (From Sunday)
2897
+ * @param {Number} weekOffset
2898
+ * @returns {Array<Date>}
2899
+ */
2900
+ function _getWeekDatesFromSun(weekOffset) {
2901
+ var dates = [];
2902
+ var currentDate = new Date();
2903
+
2904
+ // Calculate the date of Sunday
2905
+ var dayOfWeek = currentDate.getDay(); // 0 is Sunday
2906
+ currentDate.setDate(currentDate.getDate() - dayOfWeek + weekOffset * 7);
2907
+
2908
+ // Get the date of the week
2909
+ for (var i = 0; i < 7; i++) {
2910
+ var date = new Date(currentDate);
2911
+ date.setDate(currentDate.getDate() + i);
2912
+ dates.push(date);
2913
+ }
2914
+ return dates;
2915
+ }
2916
+
2917
+ /**
2918
+ * Get the date of the specified week (From Monday)
2919
+ * @param {Number} weekOffset
2920
+ * @returns {Array<Date>}
2921
+ */
2922
+ function _getWeekDatesFromMon(weekOffset) {
2923
+ var dates = [];
2924
+ var currentDate = new Date();
2925
+
2926
+ // Set the date to Monday
2927
+ var dayOfWeek = currentDate.getDay();
2928
+ var diffToMonday = dayOfWeek === 0 ? -6 : 1 - dayOfWeek;
2929
+ currentDate.setDate(currentDate.getDate() + diffToMonday + weekOffset * 7);
2930
+
2931
+ // Get the date of the week
2932
+ for (var i = 0; i < 7; i++) {
2933
+ var date = new Date(currentDate);
2934
+ date.setDate(currentDate.getDate() + i);
2935
+ dates.push(date);
2936
+ }
2937
+ return dates;
2938
+ }
2939
+
2836
2940
  /******/
2837
2941
  return __webpack_exports__;
2838
2942
  /******/
@@ -3647,13 +3751,22 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3647
3751
  tableListStartClassName = props.tableListStartClassName,
3648
3752
  tableListEndClassName = props.tableListEndClassName,
3649
3753
  tableListDividerClassName = props.tableListDividerClassName,
3754
+ _props$multipleCells = props.multipleCells,
3755
+ multipleCells = _props$multipleCells === void 0 ? false : _props$multipleCells,
3650
3756
  customTodayDate = props.customTodayDate,
3757
+ _props$appearance = props.appearance,
3758
+ appearance = _props$appearance === void 0 ? 'month' : _props$appearance,
3759
+ _props$appearanceTogg = props.appearanceToggle,
3760
+ appearanceToggle = _props$appearanceTogg === void 0 ? true : _props$appearanceTogg,
3761
+ appearanceWeekTmpl = props.appearanceWeekTmpl,
3651
3762
  eventsValue = props.eventsValue,
3652
3763
  langWeek = props.langWeek,
3653
3764
  langWeekFull = props.langWeekFull,
3654
3765
  langMonths = props.langMonths,
3655
3766
  langMonthsFull = props.langMonthsFull,
3656
3767
  langToday = props.langToday,
3768
+ langAppearanceLabelMonth = props.langAppearanceLabelMonth,
3769
+ langAppearanceLabelWeek = props.langAppearanceLabelWeek,
3657
3770
  iconRemove = props.iconRemove,
3658
3771
  iconAdd = props.iconAdd,
3659
3772
  cellCloseBtnClassName = props.cellCloseBtnClassName,
@@ -3668,7 +3781,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3668
3781
  onChangeMonth = props.onChangeMonth,
3669
3782
  onChangeYear = props.onChangeYear,
3670
3783
  onChangeToday = props.onChangeToday,
3784
+ onChangeWeek = props.onChangeWeek,
3671
3785
  onListRenderComplete = props.onListRenderComplete,
3786
+ onChangeAppearanceMode = props.onChangeAppearanceMode,
3672
3787
  modalMaskOpacity = props.modalMaskOpacity,
3673
3788
  modalMaxWidth = props.modalMaxWidth,
3674
3789
  modalMinHeight = props.modalMinHeight,
@@ -3689,7 +3804,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3689
3804
  onModalDeleteEvent = props.onModalDeleteEvent,
3690
3805
  onCellMouseEnter = props.onCellMouseEnter,
3691
3806
  onCellMouseLeave = props.onCellMouseLeave,
3807
+ onCellMouseUp = props.onCellMouseUp,
3692
3808
  onCellClick = props.onCellClick,
3809
+ onKeyPressed = props.onKeyPressed,
3693
3810
  tableListSectionTitle = props.tableListSectionTitle,
3694
3811
  tableCellMinWidth = props.tableCellMinWidth,
3695
3812
  tableTooltipDirection = props.tableTooltipDirection,
@@ -3698,6 +3815,10 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3698
3815
  tableTooltipSize = props.tableTooltipSize,
3699
3816
  tableTooltipDisabled = props.tableTooltipDisabled,
3700
3817
  id = props.id;
3818
+
3819
+ //================================================================
3820
+ // General
3821
+ //================================================================
3701
3822
  var uniqueID = funda_utils_dist_cjs_useComId__WEBPACK_IMPORTED_MODULE_3___default()();
3702
3823
  var idRes = id || uniqueID;
3703
3824
  var DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
@@ -3706,6 +3827,12 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3706
3827
  var WEEK_FULL = langWeekFull || ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY'];
3707
3828
  var MONTHS = langMonths || ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
3708
3829
  var MONTHS_FULL = langMonthsFull || ['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
3830
+ var formatToEnglishMonthDay = function formatToEnglishMonthDay(inputDate) {
3831
+ var date = new Date(inputDate);
3832
+ var month = MONTHS[date.getMonth()];
3833
+ var day = date.getDate();
3834
+ return month + ' ' + day;
3835
+ };
3709
3836
 
3710
3837
  // orginal data
3711
3838
  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
@@ -3812,18 +3939,156 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3812
3939
  tableTooltipContent = _useState34[0],
3813
3940
  setTableTooltipContent = _useState34[1];
3814
3941
 
3942
+ // appearance mode
3943
+ var _useState35 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(appearance),
3944
+ _useState36 = _slicedToArray(_useState35, 2),
3945
+ appearanceMode = _useState36[0],
3946
+ setAppearanceMode = _useState36[1];
3947
+
3815
3948
  // exposes the following methods
3816
3949
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(contentRef, function () {
3817
3950
  return {
3818
3951
  gridInit: function gridInit() {
3819
3952
  tableGridInit();
3820
3953
  },
3954
+ gridInitHeadertitle: function gridInitHeadertitle() {
3955
+ tableGridInitHeadertitle();
3956
+ },
3821
3957
  gridReset: function gridReset(cb) {
3822
3958
  tableGridReset();
3959
+ },
3960
+ resetSelectedCells: function resetSelectedCells() {
3961
+ // reset selection area
3962
+ setSelectedCells([]);
3823
3963
  }
3824
3964
  };
3825
3965
  }, [contentRef]);
3826
3966
 
3967
+ //================================================================
3968
+ // Monthly calendar
3969
+ //================================================================
3970
+ //
3971
+
3972
+ //================================================================
3973
+ // Weekly calendar
3974
+ //================================================================
3975
+ var _useState37 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),
3976
+ _useState38 = _slicedToArray(_useState37, 2),
3977
+ weekOffset = _useState38[0],
3978
+ setWeekOffset = _useState38[1];
3979
+ var handleNextWeek = function handleNextWeek() {
3980
+ setWeekOffset(weekOffset + 1);
3981
+ return weekOffset + 1;
3982
+ };
3983
+ var handlePreviousWeek = function handlePreviousWeek() {
3984
+ setWeekOffset(weekOffset - 1);
3985
+ return weekOffset - 1;
3986
+ };
3987
+ var weekDates = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getWeekDatesFromMon)(weekOffset);
3988
+ var _useState39 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
3989
+ _useState40 = _slicedToArray(_useState39, 2),
3990
+ displayWeekForHeader = _useState40[0],
3991
+ setDisplayWeekForHeader = _useState40[1];
3992
+
3993
+ //================================================================
3994
+ // Drag to activate the selection area
3995
+ //================================================================
3996
+ var _useState41 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
3997
+ _useState42 = _slicedToArray(_useState41, 2),
3998
+ isSelecting = _useState42[0],
3999
+ setIsSelecting = _useState42[1];
4000
+ var _useState43 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
4001
+ _useState44 = _slicedToArray(_useState43, 2),
4002
+ selectedCells = _useState44[0],
4003
+ setSelectedCells = _useState44[1];
4004
+ var _useState45 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
4005
+ _useState46 = _slicedToArray(_useState45, 2),
4006
+ startCell = _useState46[0],
4007
+ setStartCell = _useState46[1];
4008
+ function handleTableMainMouseUp(e) {
4009
+ setIsSelecting(false);
4010
+ }
4011
+
4012
+ // Determine whether it is a selected cell
4013
+ var isCellSelected = function isCellSelected(row, col) {
4014
+ return selectedCells.map(function (item) {
4015
+ return [item.row, item.col];
4016
+ }).some(function (_ref) {
4017
+ var _ref2 = _slicedToArray(_ref, 2),
4018
+ r = _ref2[0],
4019
+ c = _ref2[1];
4020
+ return r === row && c === col;
4021
+ });
4022
+ };
4023
+
4024
+ // Selecting now
4025
+ function handleTableMainCellMouseEnter(e, row, col) {
4026
+ var _el = e.currentTarget;
4027
+ if (isSelecting && startCell) {
4028
+ //########## MODE: WEEK #############
4029
+ var curDateList = [];
4030
+ if (appearanceMode === 'week') {
4031
+ curDateList = weekDates.map(function (v) {
4032
+ return (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(v);
4033
+ });
4034
+ }
4035
+ //########## /MODE: WEEK #############
4036
+
4037
+ //########## MODE: MONTH #############
4038
+ if (appearanceMode === 'month') {
4039
+ curDateList = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getMonthDates)(year, month + 1);
4040
+ }
4041
+ //########## /MODE: MONTH #############
4042
+
4043
+ var newSelectedCells = [];
4044
+ var _sort = [startCell.row, row].sort(function (a, b) {
4045
+ return a - b;
4046
+ }),
4047
+ _sort2 = _slicedToArray(_sort, 2),
4048
+ minRow = _sort2[0],
4049
+ maxRow = _sort2[1];
4050
+ var _sort3 = [startCell.col, col].sort(function (a, b) {
4051
+ return a - b;
4052
+ }),
4053
+ _sort4 = _slicedToArray(_sort3, 2),
4054
+ minCol = _sort4[0],
4055
+ maxCol = _sort4[1];
4056
+ for (var r = minRow; r <= maxRow; r++) {
4057
+ for (var c = minCol; c <= maxCol; c++) {
4058
+ // query date and row data
4059
+ var curRowData = val[r];
4060
+ newSelectedCells.push({
4061
+ rowData: curRowData === null || curRowData === void 0 ? void 0 : curRowData.listSection,
4062
+ date: curDateList[c],
4063
+ row: r,
4064
+ col: c
4065
+ });
4066
+ }
4067
+ }
4068
+ setSelectedCells(newSelectedCells);
4069
+ }
4070
+ }
4071
+
4072
+ // Stop selecting
4073
+ function handleTableMainCellMouseDown(e, row, col) {
4074
+ var _el = e.currentTarget;
4075
+ setIsSelecting(true);
4076
+ setStartCell({
4077
+ row: row,
4078
+ col: col
4079
+ });
4080
+ setSelectedCells([{
4081
+ rowData: JSON.parse(_el.dataset.rowinfo),
4082
+ date: _el.dataset.date,
4083
+ row: row,
4084
+ col: col
4085
+ }]);
4086
+ }
4087
+
4088
+ //================================================================
4089
+ // Other
4090
+ //================================================================
4091
+
3827
4092
  // helper buttons
3828
4093
  var _delBtn = function _delBtn() {
3829
4094
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, iconRemove ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, iconRemove) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
@@ -3871,79 +4136,155 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
3871
4136
  // cell
3872
4137
  var getCells = function getCells() {
3873
4138
  var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'none';
3874
- var currentMonth = month;
3875
- var currentStartDay = startDay;
3876
-
3877
- // previous month
3878
- if (type === 'forward') {
3879
- var _date = new Date(year, currentMonth - 1, day);
3880
- currentMonth = _date.getMonth();
3881
- currentStartDay = getStartDayOfMonth(_date);
3882
- }
3883
-
3884
- // next month
3885
- if (type === 'back') {
3886
- var _date2 = new Date(year, currentMonth + 1, day);
3887
- currentMonth = _date2.getMonth();
3888
- currentStartDay = getStartDayOfMonth(_date2);
4139
+ //########## MODE: WEEK #############
4140
+ if (appearanceMode === 'week') {
4141
+ var curWeek = [];
4142
+ weekDates.forEach(function (date, dayIndex) {
4143
+ var _dayOfWeek = new Date(date).getDay();
4144
+ // ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
4145
+ var _daysIndicator = [7, 1, 2, 3, 4, 5, 6];
4146
+ var _detail = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getDateDetails)(date);
4147
+ var _temp_year = _detail.year,
4148
+ _temp_month = _detail.month,
4149
+ _temp_day = _detail.day;
4150
+ curWeek.push({
4151
+ month: Number(_temp_month) - 1,
4152
+ startDay: _daysIndicator[_dayOfWeek],
4153
+ row: 0,
4154
+ col: [dayIndex],
4155
+ dateInfo: [{
4156
+ date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(date),
4157
+ firstGroup: false,
4158
+ lastGroup: false,
4159
+ validDisplayDate: true
4160
+ }],
4161
+ weekDisplay: [WEEK[_daysIndicator[_dayOfWeek] - 1]],
4162
+ week: [_daysIndicator[_dayOfWeek] - 1]
4163
+ });
4164
+ });
4165
+ return curWeek;
3889
4166
  }
4167
+ //########## /MODE: WEEK #############
4168
+
4169
+ //########## MODE: MONTH #############
4170
+ if (appearanceMode === 'month') {
4171
+ var currentMonth = month;
4172
+ var currentStartDay = startDay;
4173
+
4174
+ // previous month
4175
+ if (type === 'forward') {
4176
+ var _date = new Date(year, currentMonth - 1, day);
4177
+ currentMonth = _date.getMonth();
4178
+ currentStartDay = getStartDayOfMonth(_date);
4179
+ }
3890
4180
 
3891
- //
3892
- var allDays = Array(days[currentMonth] + (currentStartDay - 1)).fill(null).map(function (_, i) {
3893
- return i;
3894
- }); // [0,1,..,30,31]
3895
- var rows = Math.ceil(allDays.length / 7); // 5
3896
-
3897
- return Array.from({
3898
- length: rows
3899
- }).fill(null).map(function (_, i) {
3900
- var _col = allDays.slice(i * 7, (i + 1) * 7);
3901
-
3902
- // back fill
3903
- var backFillArr = [];
3904
- for (var k = 0; k < 7 - _col.length; k++) {
3905
- backFillArr.push(null);
4181
+ // next month
4182
+ if (type === 'back') {
4183
+ var _date2 = new Date(year, currentMonth + 1, day);
4184
+ currentMonth = _date2.getMonth();
4185
+ currentStartDay = getStartDayOfMonth(_date2);
3906
4186
  }
3907
- _col.splice.apply(_col, [_col.length, 0].concat(_toConsumableArray(backFillArr)));
3908
- return {
3909
- month: currentMonth,
3910
- startDay: currentStartDay,
3911
- row: i,
3912
- col: _col
4187
+
4188
+ //
4189
+ var allDays = Array(days[currentMonth] + (currentStartDay - 1)).fill(null).map(function (_, i) {
4190
+ return i;
4191
+ }); // [0,1,..,30,31]
4192
+ var rows = Math.ceil(allDays.length / 7); // 5
4193
+
4194
+ //
4195
+ var _tempCells = Array.from({
4196
+ length: rows
4197
+ }).fill(null);
4198
+ var _getForwardFill = function _getForwardFill(_year, _month) {
4199
+ // Get the last day of the previous month
4200
+ var lastDayOfLastMonth = new Date(_year, _month - 1, 0);
4201
+ var last7Days = [];
4202
+
4203
+ // Rewind 7 days forward from the last day
4204
+ for (var i = 0; i < 7; i++) {
4205
+ last7Days.unshift(new Date(lastDayOfLastMonth));
4206
+ lastDayOfLastMonth.setDate(lastDayOfLastMonth.getDate() - 1);
4207
+ }
4208
+ return last7Days.map(function (v) {
4209
+ return (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(v);
4210
+ });
3913
4211
  };
3914
- });
3915
- };
3916
- var getForwardFill = function getForwardFill() {
3917
- var _getCells$at, _getCells$at2;
3918
- var prevMonthStartDay = (_getCells$at = getCells('forward').at(-1)) === null || _getCells$at === void 0 ? void 0 : _getCells$at.startDay;
3919
- var prevMonthLastRowNums = (_getCells$at2 = getCells('forward').at(-1)) === null || _getCells$at2 === void 0 ? void 0 : _getCells$at2.col.filter(Boolean);
3920
- if (prevMonthLastRowNums) {
3921
- if (prevMonthLastRowNums.length === 7) return []; // no remaining
3922
-
3923
- return prevMonthLastRowNums.map(function (dayIndex) {
3924
- var d = typeof dayIndex === 'number' ? dayIndex - (prevMonthStartDay - 2) : 0;
3925
- return d;
3926
- });
3927
- } else {
3928
- return [];
3929
- }
3930
- };
3931
- var getBackFill = function getBackFill() {
3932
- var _getCells$at3, _getCells$at4;
3933
- var prevMonthStartDay = (_getCells$at3 = getCells('back').at(0)) === null || _getCells$at3 === void 0 ? void 0 : _getCells$at3.startDay;
3934
- var prevMonthLastRowNums = (_getCells$at4 = getCells('back').at(0)) === null || _getCells$at4 === void 0 ? void 0 : _getCells$at4.col.filter(Boolean);
3935
- if (prevMonthLastRowNums) {
3936
- if (prevMonthLastRowNums.length === 7) return []; // no remaining
3937
-
3938
- return prevMonthLastRowNums.map(function (dayIndex) {
3939
- var d = typeof dayIndex === 'number' ? dayIndex - (prevMonthStartDay - 2) : 0;
3940
- return d;
3941
- }).filter(function (n) {
3942
- return n > 0;
4212
+ var _getBackFill = function _getBackFill(_year, _month) {
4213
+ // Get the first day of the next month
4214
+ var firstDayOfNextMonth = new Date(_year, _month, 1);
4215
+ var first7Days = [];
4216
+
4217
+ // Rewind 7 days forward from the first day of the next month
4218
+ for (var i = 0; i < 7; i++) {
4219
+ first7Days.push(new Date(firstDayOfNextMonth));
4220
+ firstDayOfNextMonth.setDate(firstDayOfNextMonth.getDate() + 1);
4221
+ }
4222
+ return first7Days.map(function (v) {
4223
+ return (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(v);
4224
+ });
4225
+ };
4226
+ return _tempCells.map(function (_, j) {
4227
+ var _col = allDays.slice(j * 7, (j + 1) * 7);
4228
+
4229
+ // back fill
4230
+ var backFillArr = [];
4231
+ for (var k = 0; k < 7 - _col.length; k++) {
4232
+ backFillArr.push(null);
4233
+ }
4234
+ _col.splice.apply(_col, [_col.length, 0].concat(_toConsumableArray(backFillArr)));
4235
+
4236
+ //
4237
+ var isFirstGroup = j === 0;
4238
+ var isLastGroup = j === _tempCells.length - 1;
4239
+
4240
+ // forward fill
4241
+ var __forwardFillDate = _getForwardFill(year, month + 1);
4242
+
4243
+ // back fill
4244
+ var __backFillDate = _getBackFill(year, month + 1);
4245
+ var _getDateShow = function _getDateShow(_dayIndex, _m, _startDay, _month) {
4246
+ var currentDay = typeof _dayIndex === 'number' ? _dayIndex - (_startDay - 2) : 0; // ..., -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, ...
4247
+
4248
+ // date
4249
+ var _dateShow = currentDay > 0 ? "".concat(year, "-").concat(_month + 1, "-").concat(currentDay) : '';
4250
+
4251
+ // forward & back
4252
+ if (isFirstGroup && _dateShow === '') {
4253
+ _dateShow = __forwardFillDate.at(currentDay - 1);
4254
+ }
4255
+ if (isLastGroup && _dateShow === '') {
4256
+ _dateShow = __backFillDate.at(_m);
4257
+ }
4258
+ return {
4259
+ date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_dateShow),
4260
+ firstGroup: isFirstGroup,
4261
+ lastGroup: isLastGroup,
4262
+ validDisplayDate: currentDay > 0 && currentDay <= days[month]
4263
+ };
4264
+ };
4265
+
4266
+ //
4267
+ return {
4268
+ month: currentMonth,
4269
+ startDay: currentStartDay,
4270
+ row: j,
4271
+ col: _col,
4272
+ dateInfo: _col.map(function (k, m) {
4273
+ var _lastWeekDays = _col.filter(Boolean).length;
4274
+ return _getDateShow(k, m - _lastWeekDays, currentStartDay, currentMonth);
4275
+ }),
4276
+ weekDisplay: _col.map(function (k, m) {
4277
+ return WEEK[m];
4278
+ }),
4279
+ week: _col.map(function (k, m) {
4280
+ return m;
4281
+ })
4282
+ };
3943
4283
  });
3944
- } else {
3945
- return [];
3946
4284
  }
4285
+ //########## /MODE: MONTH #############
4286
+
4287
+ return [];
3947
4288
  };
3948
4289
  var queryItemObj = function queryItemObj() {
3949
4290
  var curRowData = val[tableRowNum];
@@ -4100,45 +4441,71 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4100
4441
  }
4101
4442
  var days = isLeapYear(year) ? DAYS_LEAP : DAYS;
4102
4443
  function handlePrevChange() {
4103
- setDate(function (prevState) {
4104
- var _date = new Date(year, month - 1, day);
4105
-
4106
- // update
4107
- setSelectedMonth(_date.getMonth());
4108
- setSelectedYear(_date.getFullYear());
4444
+ //########## MODE: WEEK #############
4445
+ if (appearanceMode === 'week') {
4446
+ var _latestWeekOffset = handlePreviousWeek();
4447
+ var _weekDates = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getWeekDatesFromMon)(_latestWeekOffset);
4448
+ onChangeWeek === null || onChangeWeek === void 0 ? void 0 : onChangeWeek((0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_weekDates.at(0)), (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_weekDates.at(-1)));
4449
+ }
4450
+ //########## /MODE: WEEK #############
4451
+
4452
+ //########## MODE: MONTH #############
4453
+ if (appearanceMode === 'month') {
4454
+ setDate(function (prevState) {
4455
+ var _date = new Date(year, month - 1, day);
4456
+
4457
+ // update
4458
+ setSelectedMonth(_date.getMonth());
4459
+ setSelectedYear(_date.getFullYear());
4460
+
4461
+ //
4462
+ onChangeMonth === null || onChangeMonth === void 0 ? void 0 : onChangeMonth({
4463
+ day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(day),
4464
+ month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(_date.getMonth() + 1),
4465
+ year: _date.getFullYear().toString()
4466
+ });
4109
4467
 
4110
- //
4111
- onChangeMonth === null || onChangeMonth === void 0 ? void 0 : onChangeMonth({
4112
- day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(day),
4113
- month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(_date.getMonth() + 1),
4114
- year: _date.getFullYear().toString()
4468
+ // restore table grid init status
4469
+ restoreTableGridInitStatus();
4470
+ return _date;
4115
4471
  });
4116
-
4117
- // restore table grid init status
4118
- restoreTableGridInitStatus();
4119
- return _date;
4120
- });
4472
+ }
4473
+ //########## /MODE: MONTH #############
4121
4474
  }
4122
- function handleNextChange() {
4123
- setDate(function (prevState) {
4124
- var _date = new Date(year, month + 1, day);
4125
4475
 
4126
- // update
4127
- setSelectedMonth(_date.getMonth());
4128
- setSelectedYear(_date.getFullYear());
4476
+ function handleNextChange() {
4477
+ //########## MODE: WEEK #############
4478
+ if (appearanceMode === 'week') {
4479
+ var _latestWeekOffset = handleNextWeek();
4480
+ var _weekDates2 = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getWeekDatesFromMon)(_latestWeekOffset);
4481
+ onChangeWeek === null || onChangeWeek === void 0 ? void 0 : onChangeWeek((0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_weekDates2.at(0)), (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_weekDates2.at(-1)));
4482
+ }
4483
+ //########## /MODE: WEEK #############
4484
+
4485
+ //########## MODE: MONTH #############
4486
+ if (appearanceMode === 'month') {
4487
+ setDate(function (prevState) {
4488
+ var _date = new Date(year, month + 1, day);
4489
+
4490
+ // update
4491
+ setSelectedMonth(_date.getMonth());
4492
+ setSelectedYear(_date.getFullYear());
4493
+
4494
+ //
4495
+ onChangeMonth === null || onChangeMonth === void 0 ? void 0 : onChangeMonth({
4496
+ day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(day),
4497
+ month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(_date.getMonth() + 1),
4498
+ year: _date.getFullYear().toString()
4499
+ });
4129
4500
 
4130
- //
4131
- onChangeMonth === null || onChangeMonth === void 0 ? void 0 : onChangeMonth({
4132
- day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(day),
4133
- month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(_date.getMonth() + 1),
4134
- year: _date.getFullYear().toString()
4501
+ // restore table grid init status
4502
+ restoreTableGridInitStatus();
4503
+ return _date;
4135
4504
  });
4136
-
4137
- // restore table grid init status
4138
- restoreTableGridInitStatus();
4139
- return _date;
4140
- });
4505
+ }
4506
+ //########## /MODE: MONTH #############
4141
4507
  }
4508
+
4142
4509
  function handleDayChange(e, currentDay) {
4143
4510
  setDate(new Date(year, month, currentDay));
4144
4511
  }
@@ -4184,9 +4551,21 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4184
4551
  year: _now[0]
4185
4552
  });
4186
4553
 
4554
+ //
4555
+ var weekDates = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getWeekDatesFromMon)(0);
4556
+ onChangeWeek === null || onChangeWeek === void 0 ? void 0 : onChangeWeek((0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(weekDates.at(0)), (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(weekDates.at(-1)));
4557
+ setWeekOffset(0);
4558
+
4187
4559
  // restore table grid init status
4188
4560
  restoreTableGridInitStatus();
4189
4561
  }
4562
+ function handleAppearanceChange(e) {
4563
+ var _mode = e.target.dataset.mode;
4564
+ setAppearanceMode(_mode);
4565
+
4566
+ //
4567
+ onChangeAppearanceMode === null || onChangeAppearanceMode === void 0 ? void 0 : onChangeAppearanceMode(_mode);
4568
+ }
4190
4569
  function handleShowWinYear() {
4191
4570
  setWinYear(function (prevState) {
4192
4571
  return !prevState;
@@ -4228,50 +4607,38 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4228
4607
  // colIndex
4229
4608
  var colIndex = 0;
4230
4609
  return getCells().map(function (item, j) {
4231
- var isFirstRow = j === 0;
4232
- var isLastRow = j === getCells().length - 1;
4233
-
4234
- // forward fill
4235
- var __forwardFillNum = getForwardFill();
4236
-
4237
- // back fill
4238
- var __backFillNum = getBackFill();
4239
4610
  return item.col.map(function (dayIndex, i) {
4240
4611
  colIndex++;
4241
- var d = typeof dayIndex === 'number' ? dayIndex - (startDay - 2) : 0;
4242
- var _currentData = eventSourcesData.filter(function (item) {
4243
- return (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(item.date) === (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d));
4244
- });
4245
- var isLastCol = colIndex === 7 * getCells().length;
4246
4612
 
4247
4613
  // date
4248
- var _dateShow = d > 0 ? "".concat(year, "-").concat(month + 1, "-").concat(d) : '';
4249
-
4250
- // forward & back
4251
- if (isFirstRow && __forwardFillNum && _dateShow === '') {
4252
- if (month + 1 === 1) {
4253
- _dateShow = "".concat(year - 1, "-12-").concat(__forwardFillNum[i]);
4254
- } else {
4255
- _dateShow = "".concat(year, "-").concat(month, "-").concat(__forwardFillNum[i]);
4256
- }
4257
- }
4258
- if (isLastRow && __backFillNum && _dateShow === '') {
4259
- if (month + 1 === 12) {
4260
- _dateShow = "".concat(year + 1, "-1-").concat(__backFillNum[i - item.col.filter(Boolean).length]);
4261
- } else {
4262
- _dateShow = "".concat(year, "-").concat(month + 2, "-").concat(__backFillNum[i - item.col.filter(Boolean).length]);
4614
+ var _dateShow = item.dateInfo[i].date;
4615
+ var _dateDayShow = _dateShow.split('-').at(-1);
4616
+
4617
+ // week day
4618
+ var weekDay = item.week[i];
4619
+ var _weekDayStr = SHOW_WEEK ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
4620
+ dangerouslySetInnerHTML: {
4621
+ __html: item.weekDisplay[i]
4263
4622
  }
4264
- }
4623
+ }) : null;
4624
+
4625
+ // helper
4626
+ var d = parseFloat(_dateDayShow);
4627
+ var _currentData = eventSourcesData.filter(function (item) {
4628
+ return (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(item.date) === _dateShow;
4629
+ });
4630
+ var isLastCol = colIndex === 7 * getCells().length;
4631
+ var isInteractive = item.dateInfo[i].validDisplayDate; // The date on which the user interaction can occur, e.g. click, modify
4632
+ var isForward = item.dateInfo[i].firstGroup && !isInteractive;
4633
+ var isBack = item.dateInfo[i].lastGroup && !isInteractive;
4265
4634
 
4266
4635
  // days
4267
4636
  //------
4268
4637
  if (!showEvents) {
4269
4638
  var _thContent = function _thContent() {
4270
- var isForward = isFirstRow && __forwardFillNum && typeof __forwardFillNum[i] !== 'undefined';
4271
- var isBack = isLastRow && __backFillNum && typeof __backFillNum[i - item.col.filter(Boolean).length] !== 'undefined';
4272
4639
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("th", {
4273
4640
  className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)('e-cal-timeline-table__cell-cushion-headercontent__container', {
4274
- 'empty': d <= 0,
4641
+ 'empty': !isInteractive,
4275
4642
  'today': d === now.getDate(),
4276
4643
  'selected': d === day,
4277
4644
  'last-cell': isLastCol
@@ -4280,13 +4647,16 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4280
4647
  "data-index": colIndex - 1,
4281
4648
  "data-datagrid-col": colIndex - 1,
4282
4649
  colSpan: 1,
4283
- "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_dateShow),
4284
- "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(d),
4285
- "data-week": i,
4650
+ "data-date": _dateShow,
4651
+ "data-day": _dateDayShow,
4652
+ "data-week": weekDay,
4286
4653
  style: {
4287
4654
  minWidth: CELL_MIN_W + 'px'
4288
4655
  },
4289
- onClick: function onClick(e) {
4656
+ onMouseEnter: function onMouseEnter(e) {
4657
+ onCellMouseEnter === null || onCellMouseEnter === void 0 ? void 0 : onCellMouseEnter(e);
4658
+ },
4659
+ onMouseDown: function onMouseDown(e) {
4290
4660
  // update row data
4291
4661
  setTableRowNum(-1);
4292
4662
 
@@ -4296,56 +4666,48 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4296
4666
  _currentData[0].rowData = listSectionData;
4297
4667
  }
4298
4668
 
4669
+ // reset selection area
4670
+ setSelectedCells([]);
4671
+
4299
4672
  //
4300
- if (d > 0) {
4673
+ if (isInteractive) {
4301
4674
  handleDayChange(e, d); // update current day
4302
4675
 
4303
4676
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _currentData.length === 0 ? {
4304
4677
  rowData: listSectionData,
4305
4678
  id: 0,
4306
- date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
4679
+ date: _dateShow
4307
4680
  } : _currentData[0]);
4308
4681
  if (EVENTS_ENABLED) {
4309
4682
  onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(_currentData.length === 0 ? {
4310
4683
  rowData: listSectionData,
4311
4684
  id: 0,
4312
- date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
4685
+ date: _dateShow
4313
4686
  } : _currentData[0], function () {
4314
4687
  return setShowEdit(true);
4315
4688
  }, 'normal');
4316
4689
  }
4317
4690
  }
4691
+ },
4692
+ onMouseLeave: function onMouseLeave(e) {
4693
+ onCellMouseLeave === null || onCellMouseLeave === void 0 ? void 0 : onCellMouseLeave(e);
4694
+ },
4695
+ onMouseUp: function onMouseUp(e) {
4696
+ onCellMouseUp === null || onCellMouseUp === void 0 ? void 0 : onCellMouseUp(e, selectedCells);
4318
4697
  }
4319
- }, !FILL_BLANK_DATE_DISABLD && isForward ? /*#__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", {
4320
- className: "e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-headercontent disabled",
4321
- style: {
4322
- width: CELL_MIN_W - 1 + 'px'
4323
- }
4324
- }, __forwardFillNum[i])) : null, d > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, FILL_BLANK_DATE_DISABLD ? /*#__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", {
4325
- className: "e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-headercontent",
4326
- style: {
4327
- width: CELL_MIN_W - 1 + 'px'
4328
- }
4329
- }, d, SHOW_WEEK ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
4330
- dangerouslySetInnerHTML: {
4331
- __html: WEEK[i]
4332
- }
4333
- }) : null)) : /*#__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", {
4334
- className: "e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-headercontent",
4335
- style: {
4336
- width: CELL_MIN_W - 1 + 'px'
4337
- }
4338
- }, d))) : null, !FILL_BLANK_DATE_DISABLD && isBack ? /*#__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", {
4339
- className: "e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-headercontent disabled",
4698
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
4699
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)('e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-headercontent', {
4700
+ 'disabled': !isInteractive
4701
+ }),
4340
4702
  style: {
4341
4703
  width: CELL_MIN_W - 1 + 'px'
4342
4704
  }
4343
- }, __backFillNum[i - item.col.filter(Boolean).length])) : null);
4705
+ }, d, _weekDayStr));
4344
4706
  };
4345
4707
  if (!FILL_BLANK_DATE_DISABLD) {
4346
4708
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, _thContent());
4347
4709
  } else {
4348
- return d > 0 && d <= days[month] ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, _thContent()) : null;
4710
+ return isInteractive ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, _thContent()) : null;
4349
4711
  }
4350
4712
  }
4351
4713
 
@@ -4374,9 +4736,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4374
4736
  key: "cell-item-".concat(rowIndex, "-").concat(cellItemIndex, "}"),
4375
4737
  "data-overlay-id": "e-cal-timeline-table__cell-tooltipwrapper-".concat(idRes),
4376
4738
  "data-cell-item-index": cellItemIndex,
4377
- "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_dateShow),
4378
- "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(d),
4379
- "data-week": i,
4739
+ "data-date": _dateShow,
4740
+ "data-day": _dateDayShow,
4741
+ "data-week": weekDay,
4380
4742
  "data-row": rowIndex,
4381
4743
  onMouseEnter: function onMouseEnter(e) {
4382
4744
  e.stopPropagation();
@@ -4409,7 +4771,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4409
4771
  (_cellItem$callback = cellItem.callback) === null || _cellItem$callback === void 0 ? void 0 : _cellItem$callback.call(cellItem);
4410
4772
 
4411
4773
  //
4412
- if (d > 0) {
4774
+ if (isInteractive) {
4413
4775
  handleDayChange(e, d); // update current day
4414
4776
 
4415
4777
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, cellItem);
@@ -4423,18 +4785,18 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4423
4785
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
4424
4786
  className: "e-cal-timeline__day__event",
4425
4787
  style: typeof cellItem !== 'undefined' && cellItem.eventStyles !== 'undefined' ? cellItem.eventStyles : {},
4426
- dangerouslySetInnerHTML: {
4788
+ dangerouslySetInnerHTML: typeof cellItem.data === 'string' ? {
4427
4789
  __html: cellItem.data
4428
- }
4429
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
4790
+ } : undefined
4791
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().isValidElement(cellItem.data) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, cellItem.data) : null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
4430
4792
  className: "e-cal-timeline__day__eventdel ".concat(cellCloseBtnClassName || '')
4431
4793
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
4432
4794
  href: "#",
4433
4795
  tabIndex: -1,
4434
4796
  className: "align-middle",
4435
- "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_dateShow),
4436
- "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(d),
4437
- "data-week": i,
4797
+ "data-date": _dateShow,
4798
+ "data-day": _dateDayShow,
4799
+ "data-week": weekDay,
4438
4800
  "data-row": rowIndex,
4439
4801
  onClick: function onClick(e) {
4440
4802
  e.preventDefault();
@@ -4451,13 +4813,13 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4451
4813
  }
4452
4814
 
4453
4815
  //
4454
- if (d > 0) {
4816
+ if (isInteractive) {
4455
4817
  handleDayChange(e, d); // update current day
4456
4818
 
4457
4819
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
4458
4820
  rowData: listSectionData,
4459
4821
  id: 0,
4460
- date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
4822
+ date: _dateShow
4461
4823
  });
4462
4824
  if (EVENTS_DELETE_ENABLED) {
4463
4825
  onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_existsContent, function () {
@@ -4470,50 +4832,70 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4470
4832
  });
4471
4833
  };
4472
4834
  var _tdContent = function _tdContent() {
4473
- var isForward = isFirstRow && __forwardFillNum && typeof __forwardFillNum[i] !== 'undefined';
4474
- var isBack = isLastRow && __backFillNum && typeof __backFillNum[i - item.col.filter(Boolean).length] !== 'undefined';
4835
+ var _val$rowIndex;
4475
4836
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("td", {
4476
4837
  className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)('e-cal-timeline-table__cell-cushion-content__container e-cal-timeline-table__cell-tooltiptrigger', {
4477
4838
  'has-event': eventSourcesData && _currentData.length > 0,
4478
- 'empty': d <= 0,
4839
+ 'empty': !isInteractive,
4479
4840
  'today': d === now.getDate(),
4480
- 'selected': d === day && tableRowNum === rowIndex,
4841
+ 'selected': isCellSelected(rowIndex, dayIndex),
4481
4842
  'last-cell': isLastCol
4482
4843
  }),
4483
4844
  key: "col" + i,
4484
4845
  "data-index": colIndex - 1,
4485
4846
  colSpan: 1,
4486
- "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_dateShow),
4487
- "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(d),
4488
- "data-week": i,
4847
+ "data-rowinfo": JSON.stringify((_val$rowIndex = val[rowIndex]) === null || _val$rowIndex === void 0 ? void 0 : _val$rowIndex.listSection),
4848
+ "data-date": _dateShow,
4849
+ "data-day": _dateDayShow,
4850
+ "data-week": weekDay,
4489
4851
  "data-row": rowIndex,
4490
4852
  onMouseEnter: function onMouseEnter(e) {
4491
4853
  onCellMouseEnter === null || onCellMouseEnter === void 0 ? void 0 : onCellMouseEnter(e);
4854
+
4855
+ //
4856
+ if (multipleCells) handleTableMainCellMouseEnter(e, rowIndex, dayIndex);
4492
4857
  },
4493
- onMouseLeave: function onMouseLeave(e) {
4494
- onCellMouseLeave === null || onCellMouseLeave === void 0 ? void 0 : onCellMouseLeave(e);
4495
- },
4496
- onClick: function onClick(e) {
4858
+ onMouseDown: function onMouseDown(e) {
4859
+ var _val$rowIndex2;
4497
4860
  //
4498
- onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(e);
4499
- if (d > 0) {
4861
+ onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(e, {
4862
+ rowData: (_val$rowIndex2 = val[rowIndex]) === null || _val$rowIndex2 === void 0 ? void 0 : _val$rowIndex2.listSection,
4863
+ date: _dateShow,
4864
+ row: rowIndex,
4865
+ col: dayIndex
4866
+ });
4867
+ if (isInteractive) {
4500
4868
  handleDayChange(e, d); // update current day
4501
4869
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, null);
4502
4870
  }
4871
+ if (multipleCells) handleTableMainCellMouseDown(e, rowIndex, dayIndex);
4872
+ },
4873
+ onMouseLeave: function onMouseLeave(e) {
4874
+ onCellMouseLeave === null || onCellMouseLeave === void 0 ? void 0 : onCellMouseLeave(e);
4875
+ },
4876
+ onMouseUp: function onMouseUp(e) {
4877
+ onCellMouseUp === null || onCellMouseUp === void 0 ? void 0 : onCellMouseUp(e, selectedCells);
4878
+ }
4879
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
4880
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)('e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-content', {
4881
+ 'disabled': !isInteractive
4882
+ }),
4883
+ style: {
4884
+ width: CELL_MIN_W - 1 + 'px'
4885
+ }
4886
+ }, _eventContent() || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
4887
+ style: {
4888
+ userSelect: 'none'
4503
4889
  }
4504
- }, !FILL_BLANK_DATE_DISABLD && isForward ? /*#__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", {
4505
- className: "e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-content disabled"
4506
- }, "\xA0")) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
4507
- className: "e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-content"
4508
- }, _eventContent(), isForward || isBack ? null : /*#__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", {
4890
+ }, "\xA0")), isForward || isBack ? null : /*#__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", {
4509
4891
  className: "e-cal-timeline__day__eventadd ".concat(cellAddBtnClassName || '')
4510
4892
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
4511
4893
  href: "#",
4512
4894
  tabIndex: -1,
4513
4895
  className: "align-middle",
4514
- "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)(_dateShow),
4515
- "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.padZero)(d),
4516
- "data-week": i,
4896
+ "data-date": _dateShow,
4897
+ "data-day": _dateDayShow,
4898
+ "data-week": weekDay,
4517
4899
  "data-row": rowIndex,
4518
4900
  onClick: function onClick(e) {
4519
4901
  e.preventDefault();
@@ -4526,43 +4908,41 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4526
4908
  setTableCellId(-1);
4527
4909
 
4528
4910
  //
4529
- if (d > 0) {
4911
+ if (isInteractive) {
4530
4912
  handleDayChange(e, d); // update current day
4531
4913
 
4532
4914
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
4533
4915
  rowData: listSectionData,
4534
4916
  id: 0,
4535
- date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
4917
+ date: _dateShow
4536
4918
  });
4537
4919
  if (EVENTS_ENABLED) {
4538
4920
  onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen({
4539
4921
  rowData: listSectionData,
4540
4922
  id: 0,
4541
- date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
4923
+ date: _dateShow
4542
4924
  }, function () {
4543
4925
  return setShowEdit(true);
4544
4926
  }, 'new');
4545
4927
  }
4546
4928
  }
4547
4929
  }
4548
- }, _addBtn())))), !FILL_BLANK_DATE_DISABLD && isBack ? /*#__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", {
4549
- className: "e-cal-timeline-table__cell-cushion e-cal-timeline-table__cell-cushion-content disabled"
4550
- }, "\xA0")) : null);
4930
+ }, _addBtn())))));
4551
4931
  };
4552
4932
  if (!FILL_BLANK_DATE_DISABLD) {
4553
4933
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, _tdContent());
4554
4934
  } else {
4555
- return d > 0 && d <= days[month] ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, _tdContent()) : null;
4935
+ return isInteractive ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, _tdContent()) : null;
4556
4936
  }
4557
4937
  }
4558
4938
  });
4559
4939
  });
4560
4940
  }
4561
4941
  function generateColUi() {
4562
- if (FILL_BLANK_DATE_DISABLD) {
4563
- //#######################
4942
+ {/* //########## MODE: WEEK ############# */}
4943
+ if (appearanceMode === 'week') {
4564
4944
  return Array.from({
4565
- length: days[month]
4945
+ length: 7
4566
4946
  }).fill(0).map(function (item, i) {
4567
4947
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("col", {
4568
4948
  key: "col-placeholder-" + i,
@@ -4573,30 +4953,50 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4573
4953
  }
4574
4954
  });
4575
4955
  });
4576
- //#######################
4577
- } else {
4578
- //#######################
4579
- // colIndex
4580
- var colIndex = 0;
4581
- return getCells().map(function (item, j) {
4582
- return item.col.map(function (dayIndex, i) {
4583
- colIndex++;
4584
- var d = typeof dayIndex === 'number' ? dayIndex - (startDay - 2) : 0;
4956
+ }
4957
+ {/* //########## /MODE: WEEK ############# */}
4958
+ {/* //########## MODE: MONTH ############# */}
4959
+ if (appearanceMode === 'month') {
4960
+ if (FILL_BLANK_DATE_DISABLD) {
4961
+ return Array.from({
4962
+ length: days[month]
4963
+ }).fill(0).map(function (item, i) {
4585
4964
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("col", {
4586
- className: "".concat(d > 0 ? '' : 'empty'),
4587
4965
  key: "col-placeholder-" + i,
4588
- "data-index": colIndex - 1,
4589
- "data-datagrid-col": colIndex - 1,
4966
+ "data-index": i,
4967
+ "data-datagrid-col": i,
4590
4968
  style: {
4591
4969
  minWidth: CELL_MIN_W + 'px'
4592
4970
  }
4593
4971
  });
4594
4972
  });
4595
- });
4596
- //#######################
4973
+ } else {
4974
+ // colIndex
4975
+ var colIndex = 0;
4976
+ return getCells().map(function (item, j) {
4977
+ return item.col.map(function (dayIndex, i) {
4978
+ colIndex++;
4979
+
4980
+ // helper
4981
+ var isInteractive = item.dateInfo[i].validDisplayDate; // The date on which the user interaction can occur, e.g. click, modify
4982
+
4983
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("col", {
4984
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)({
4985
+ 'empty': !isInteractive
4986
+ }),
4987
+ key: "col-placeholder-" + i,
4988
+ "data-index": colIndex - 1,
4989
+ "data-datagrid-col": colIndex - 1,
4990
+ style: {
4991
+ minWidth: CELL_MIN_W + 'px'
4992
+ }
4993
+ });
4994
+ });
4995
+ });
4996
+ }
4597
4997
  }
4998
+ {/* //########## /MODE: MONTH ############# */}
4598
4999
  }
4599
-
4600
5000
  function syncTableScrollHeader() {
4601
5001
  var el = scrollHeaderRef.current;
4602
5002
  if (el === null) return;
@@ -4622,58 +5022,118 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4622
5022
  if (scrollListRef.current) scrollListRef.current.scrollTop = 0;
4623
5023
  if (scrollBodyRef.current) scrollBodyRef.current.scrollLeft = 0;
4624
5024
  }
5025
+ function tableGridInitHeadertitle() {
5026
+ //
5027
+ if (tableGridRef.current === null) return;
5028
+ var tableGridEl = tableGridRef.current;
5029
+
5030
+ // initialize cell height
5031
+ var headerTitleTrElements = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__title tbody').getElementsByTagName('tr');
5032
+ var trElements = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__content tbody').getElementsByTagName('tr');
5033
+ for (var i = 0; i < headerTitleTrElements.length; i++) {
5034
+ var targetElement = headerTitleTrElements[i].offsetHeight > trElements[i].offsetHeight ? headerTitleTrElements[i] : trElements[i];
5035
+ var tdOHeight = window.getComputedStyle(targetElement).height;
5036
+ headerTitleTrElements[i].style.height = tdOHeight;
5037
+ trElements[i].style.height = tdOHeight;
5038
+ }
5039
+ }
4625
5040
  function tableGridInit() {
4626
- var scrollBarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4627
5041
  //
4628
5042
  if (tableGridRef.current === null) return;
4629
5043
  var tableGridEl = tableGridRef.current;
5044
+ var _curCellMinWidth = CELL_MIN_W;
5045
+ var _curColCount = FILL_BLANK_DATE_DISABLD ? days[month] : 7 * getCells().length;
5046
+ if (appearanceMode === 'week') {
5047
+ _curColCount = 7;
5048
+ }
5049
+
5050
+ //****************
5051
+ // STEP 1-1:
5052
+ //****************
5053
+ // calculate min width (MODE: WEEK)
5054
+ //--------------
5055
+ if (appearanceMode === 'week') {
5056
+ var tableMaxWidth = tableGridEl.clientWidth;
5057
+ var tableHeaderTitleWidth = tableGridEl.querySelector('.e-cal-timeline-table__cell-cushion-headertitle').clientWidth;
5058
+ var tableDividerWidth = tableGridEl.querySelector('.e-cal-timeline-table__timeline-divider').clientWidth;
5059
+ var tableBorderWidth = 4;
5060
+ var scrollMaxWidth = tableMaxWidth - tableHeaderTitleWidth - tableDividerWidth - tableBorderWidth;
5061
+ _curCellMinWidth = scrollMaxWidth / 7;
5062
+ _curColCount = 7;
5063
+
5064
+ // header
5065
+ tableGridEl.querySelectorAll('.e-cal-timeline-table__cell-cushion-headercontent__container, .e-cal-timeline-table__cell-cushion-content').forEach(function (node) {
5066
+ node.style.width = _curCellMinWidth + 'px';
5067
+ });
5068
+ }
4630
5069
 
4631
5070
  //****************
4632
- // STEP 1:
5071
+ // STEP 1-2:
4633
5072
  //****************
4634
- // calculate min width
5073
+ // calculate min width (MODE: MONTH)
4635
5074
  //--------------
4636
- var cellMinWidth = CELL_MIN_W;
4637
- var colCount = FILL_BLANK_DATE_DISABLD ? days[month] : 7 * getCells().length;
5075
+ var cellMinWidth = _curCellMinWidth;
5076
+ var colCount = _curColCount;
4638
5077
  var scrollableMinWidth = cellMinWidth * colCount;
4639
5078
 
5079
+ //****************
5080
+ // STEP 1-3:
5081
+ //****************
5082
+ // initialize "header & main" cells
5083
+ //--------------
5084
+ var headerThContentContainers = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-header__content tbody').getElementsByTagName('th');
5085
+ for (var i = 0; i < headerThContentContainers.length; i++) {
5086
+ var curHeaderThContent = headerThContentContainers[i].querySelector('.e-cal-timeline-table__cell-cushion-headercontent');
5087
+ if (curHeaderThContent !== null) curHeaderThContent.style.width = _curCellMinWidth + 'px';
5088
+ }
5089
+ var mainTdContentContainers = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__content tbody').getElementsByTagName('td');
5090
+ for (var _i2 = 0; _i2 < mainTdContentContainers.length; _i2++) {
5091
+ var _curHeaderThContent = mainTdContentContainers[_i2].querySelector('.e-cal-timeline-table__cell-cushion-content');
5092
+ if (_curHeaderThContent !== null) _curHeaderThContent.style.width = _curCellMinWidth + 'px';
5093
+ }
5094
+ var mainTdContentCols = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__content colgroup').getElementsByTagName('col');
5095
+ for (var _i3 = 0; _i3 < mainTdContentCols.length; _i3++) {
5096
+ mainTdContentCols[_i3].style.minWidth = _curCellMinWidth + 'px';
5097
+ }
5098
+
4640
5099
  //****************
4641
5100
  // STEP 2:
4642
5101
  //****************
4643
5102
  // initialize scrollable wrapper (width)
4644
5103
  //--------------
4645
- var _scrollableWrapper = [];
4646
- if (scrollBarInit) {
4647
- _scrollableWrapper = tableGridEl.querySelectorAll('.e-cal-timeline-table__scroller-harness');
4648
- [].slice.call(_scrollableWrapper).forEach(function (el) {
4649
- var scrollType = el.dataset.scroll;
4650
- if (scrollType !== 'list') {
4651
- var _content = el.querySelector('.e-cal-timeline-table__scroller');
4652
- var tableMaxWidth = tableGridEl.clientWidth;
4653
- var tableHeaderTitleWidth = tableGridEl.querySelector('.e-cal-timeline-table__cell-cushion-headertitle').clientWidth;
4654
- var tableDividerWidth = tableGridEl.querySelector('.e-cal-timeline-table__timeline-divider').clientWidth;
4655
- var tableBorderWidth = 4;
4656
- var scrollMaxWidth = tableMaxWidth - tableHeaderTitleWidth - tableDividerWidth - tableBorderWidth;
4657
- el.dataset.width = scrollMaxWidth;
4658
- el.style.maxWidth = el.dataset.width + 'px';
4659
- _content.style.minWidth = scrollableMinWidth + 'px';
4660
- }
4661
- });
4662
- }
5104
+ var _scrollableWrapper = tableGridEl.querySelectorAll('.e-cal-timeline-table__scroller-harness');
5105
+ [].slice.call(_scrollableWrapper).forEach(function (el) {
5106
+ var scrollType = el.dataset.scroll;
5107
+ if (appearanceMode === 'week') {
5108
+ el.classList.add('e-cal-timeline-table__scroller-harness--hideX');
5109
+ }
5110
+ if (appearanceMode === 'month') {
5111
+ el.classList.remove('e-cal-timeline-table__scroller-harness--hideX');
5112
+ }
5113
+ if (scrollType !== 'list') {
5114
+ var _content = el.querySelector('.e-cal-timeline-table__scroller');
5115
+ var _tableMaxWidth = tableGridEl.clientWidth;
5116
+ var _tableHeaderTitleWidth = tableGridEl.querySelector('.e-cal-timeline-table__cell-cushion-headertitle').clientWidth;
5117
+ var _tableDividerWidth = tableGridEl.querySelector('.e-cal-timeline-table__timeline-divider').clientWidth;
5118
+ var _tableBorderWidth = 4;
5119
+ var _scrollMaxWidth = _tableMaxWidth - _tableHeaderTitleWidth - _tableDividerWidth - _tableBorderWidth;
5120
+ el.dataset.width = _scrollMaxWidth;
5121
+ el.style.maxWidth = el.dataset.width + 'px';
5122
+ _content.style.minWidth = scrollableMinWidth + 'px';
5123
+ }
5124
+ });
4663
5125
 
4664
5126
  //****************
4665
5127
  // STEP 3:
4666
5128
  //****************
4667
5129
  // initialize cell width
4668
5130
  //--------------
4669
- var headerThElements = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-header__content tbody').getElementsByTagName('th');
4670
- var colElements = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__content colgroup').getElementsByTagName('col');
4671
- var tdElements = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__content tbody').getElementsByTagName('td');
4672
- var tdElementMaxWidth = typeof tdElements[0] === 'undefined' ? 0 : parseFloat(window.getComputedStyle(tdElements[0].querySelector('.e-cal-timeline-table__cell-cushion-content')).maxWidth);
5131
+ var tdElementMaxWidth = typeof mainTdContentContainers[0] === 'undefined' ? 0 : parseFloat(window.getComputedStyle(mainTdContentContainers[0].querySelector('.e-cal-timeline-table__cell-cushion-content')).maxWidth);
4673
5132
  if (Array.isArray(eventsValue) && eventsValue.length > 0) {
4674
- for (var i = 0; i < headerThElements.length; i++) {
4675
- var curHeaderThElementMaxWidth = parseFloat(window.getComputedStyle(headerThElements[i].querySelector('.e-cal-timeline-table__cell-cushion-headercontent')).width);
4676
- var targetElement = headerThElements[i].offsetWidth > tdElements[i].offsetWidth ? headerThElements[i] : tdElements[i];
5133
+ for (var _i4 = 0; _i4 < headerThContentContainers.length; _i4++) {
5134
+ var _curHeaderThContent2 = headerThContentContainers[_i4].querySelector('.e-cal-timeline-table__cell-cushion-headercontent');
5135
+ var curHeaderThContentMaxWidth = parseFloat(window.getComputedStyle(_curHeaderThContent2).width);
5136
+ var targetElement = headerThContentContainers[_i4].offsetWidth > mainTdContentContainers[_i4].offsetWidth ? headerThContentContainers[_i4] : mainTdContentContainers[_i4];
4677
5137
  var tdOwidth = parseFloat(window.getComputedStyle(targetElement).width);
4678
5138
 
4679
5139
  // check td max width
@@ -4682,15 +5142,14 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4682
5142
  }
4683
5143
 
4684
5144
  // check header th max width
4685
- if (tdElementMaxWidth > 0 && tdElementMaxWidth < curHeaderThElementMaxWidth) {
4686
- tdOwidth = curHeaderThElementMaxWidth;
5145
+ if (tdElementMaxWidth > 0 && tdElementMaxWidth < curHeaderThContentMaxWidth) {
5146
+ tdOwidth = curHeaderThContentMaxWidth;
4687
5147
  }
4688
5148
 
4689
5149
  // Prevent the width from being +1 each time it is initialized
4690
5150
  tdOwidth = tdOwidth - 1;
4691
- headerThElements[i].querySelector('.e-cal-timeline-table__cell-cushion-headercontent').style.width = tdOwidth + 'px';
4692
- tdElements[i].querySelector('.e-cal-timeline-table__cell-cushion-content').style.minWidth = tdOwidth + 'px';
4693
- colElements[i].style.minWidth = tdOwidth + 'px';
5151
+ headerThContentContainers[_i4].querySelector('.e-cal-timeline-table__cell-cushion-headercontent').style.width = tdOwidth + 'px';
5152
+ mainTdContentCols[_i4].style.minWidth = tdOwidth + 'px';
4694
5153
  }
4695
5154
  }
4696
5155
 
@@ -4720,32 +5179,23 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4720
5179
  //****************
4721
5180
  // initialize cell height
4722
5181
  //--------------
4723
- var headerTitleTrElements = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__title tbody').getElementsByTagName('tr');
4724
- var trElements = tableGridEl.querySelector('.e-cal-timeline-table__datagrid-body__content tbody').getElementsByTagName('tr');
4725
- for (var _i2 = 0; _i2 < headerTitleTrElements.length; _i2++) {
4726
- var _targetElement = headerTitleTrElements[_i2].offsetHeight > trElements[_i2].offsetHeight ? headerTitleTrElements[_i2] : trElements[_i2];
4727
- var tdOHeight = window.getComputedStyle(_targetElement).height;
4728
- headerTitleTrElements[_i2].style.height = tdOHeight;
4729
- trElements[_i2].style.height = tdOHeight;
4730
- }
5182
+ tableGridInitHeadertitle();
4731
5183
 
4732
5184
  //****************
4733
5185
  // STEP 6:
4734
5186
  //****************
4735
5187
  //initialize scrollable wrapper (height)
4736
5188
  //--------------
4737
- if (scrollBarInit) {
4738
- [].slice.call(_scrollableWrapper).forEach(function (el) {
4739
- var scrollType = el.dataset.scroll;
4740
- var oldHeight = el.clientHeight;
4741
- if (scrollType !== 'header') {
4742
- var tableWrapperMaxHeight = window.getComputedStyle(tableGridEl).height;
4743
- if (oldHeight > parseFloat(tableWrapperMaxHeight)) {
4744
- el.style.height = tableWrapperMaxHeight;
4745
- }
5189
+ [].slice.call(_scrollableWrapper).forEach(function (el) {
5190
+ var scrollType = el.dataset.scroll;
5191
+ var oldHeight = el.clientHeight;
5192
+ if (scrollType !== 'header') {
5193
+ var tableWrapperMaxHeight = window.getComputedStyle(tableGridEl).height;
5194
+ if (oldHeight > parseFloat(tableWrapperMaxHeight)) {
5195
+ el.style.height = tableWrapperMaxHeight;
4746
5196
  }
4747
- });
4748
- }
5197
+ }
5198
+ });
4749
5199
 
4750
5200
  //****************
4751
5201
  // STEP 7:
@@ -4753,23 +5203,45 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4753
5203
  // display wrapper
4754
5204
  //--------------
4755
5205
  tableGridEl.classList.remove('invisible');
5206
+
5207
+ //****************
5208
+ // STEP 1-1:
5209
+ //****************
5210
+ // calculate min width (MODE: WEEK)
5211
+ //--------------
5212
+ if (appearanceMode === 'week') {
5213
+ var _tableMaxWidth2 = tableGridEl.clientWidth;
5214
+ var _tableHeaderTitleWidth2 = tableGridEl.querySelector('.e-cal-timeline-table__cell-cushion-headertitle').clientWidth;
5215
+ var _tableDividerWidth2 = tableGridEl.querySelector('.e-cal-timeline-table__timeline-divider').clientWidth;
5216
+ var _tableBorderWidth2 = 4;
5217
+ var _scrollMaxWidth2 = _tableMaxWidth2 - _tableHeaderTitleWidth2 - _tableDividerWidth2 - _tableBorderWidth2;
5218
+ _curCellMinWidth = _scrollMaxWidth2 / 7;
5219
+ _curColCount = 7;
5220
+
5221
+ // header content
5222
+ tableGridEl.querySelectorAll('.e-cal-timeline-table__cell-cushion-headercontent__container, .e-cal-timeline-table__cell-cushion-headercontent').forEach(function (node) {
5223
+ node.style.width = _curCellMinWidth + 'px';
5224
+ });
5225
+
5226
+ // main content
5227
+ tableGridEl.querySelectorAll('.e-cal-timeline-table__cell-cushion-content').forEach(function (node) {
5228
+ node.style.width = _curCellMinWidth + 'px';
5229
+ });
5230
+ }
4756
5231
  }
4757
5232
  function tableGridReset() {
4758
- var scrollBarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4759
5233
  if (tableGridRef.current === null) return;
4760
5234
  var tableGridEl = tableGridRef.current;
4761
5235
 
4762
5236
  // initialize scrollable wrapper (width & height)
4763
5237
  //--------------
4764
- if (scrollBarInit) {
4765
- var _scrollableWrapper = tableGridEl.querySelectorAll('.e-cal-timeline-table__scroller-harness');
4766
- [].slice.call(_scrollableWrapper).forEach(function (el) {
4767
- var _content = el.querySelector('.e-cal-timeline-table__scroller');
4768
- el.removeAttribute('data-width');
4769
- el.removeAttribute('style');
4770
- _content.removeAttribute('style');
4771
- });
4772
- }
5238
+ var _scrollableWrapper = tableGridEl.querySelectorAll('.e-cal-timeline-table__scroller-harness');
5239
+ [].slice.call(_scrollableWrapper).forEach(function (el) {
5240
+ var _content = el.querySelector('.e-cal-timeline-table__scroller');
5241
+ el.removeAttribute('data-width');
5242
+ el.removeAttribute('style');
5243
+ _content.removeAttribute('style');
5244
+ });
4773
5245
 
4774
5246
  // initialize cell height
4775
5247
  //--------------
@@ -4803,9 +5275,16 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4803
5275
  year: year.toString()
4804
5276
  });
4805
5277
  }, [year]);
5278
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
5279
+ if (typeof appearanceWeekTmpl === 'function') {
5280
+ setDisplayWeekForHeader([getCells().at(0).dateInfo[0].date, getCells().at(-1).dateInfo[0].date]);
5281
+ } else {
5282
+ setDisplayWeekForHeader([formatToEnglishMonthDay(getCells().at(0).dateInfo[0].date), formatToEnglishMonthDay(getCells().at(-1).dateInfo[0].date)]);
5283
+ }
5284
+ }, [weekOffset]);
4806
5285
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
4807
5286
  // update events value
4808
- if (Array.isArray(eventsValue)) setVal(eventsValue);
5287
+ if (Array.isArray(eventsValue) && eventsValue.length > 0) setVal(eventsValue);
4809
5288
 
4810
5289
  // update current today
4811
5290
  if (typeof customTodayDate !== 'undefined' && (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_6__.isValidDate)(customTodayDate)) {
@@ -4819,9 +5298,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4819
5298
  // reset table grid
4820
5299
  tableGridReset();
4821
5300
  };
4822
- }, [eventsValue, customTodayDate]);
5301
+ }, [eventsValue, customTodayDate, appearanceMode]);
4823
5302
  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", {
4824
- className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)("e-cal-timeline__wrapper", calendarWrapperClassName)
5303
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)("e-cal-timeline__wrapper e-cal-timeline__wrapper--".concat(appearanceMode), calendarWrapperClassName)
4825
5304
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
4826
5305
  className: "e-cal-timeline__header bg-body-tertiary"
4827
5306
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
@@ -4837,7 +5316,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4837
5316
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
4838
5317
  d: "M14.2893 5.70708C13.8988 5.31655 13.2657 5.31655 12.8751 5.70708L7.98768 10.5993C7.20729 11.3805 7.2076 12.6463 7.98837 13.427L12.8787 18.3174C13.2693 18.7079 13.9024 18.7079 14.293 18.3174C14.6835 17.9269 14.6835 17.2937 14.293 16.9032L10.1073 12.7175C9.71678 12.327 9.71678 11.6939 10.1073 11.3033L14.2893 7.12129C14.6799 6.73077 14.6799 6.0976 14.2893 5.70708Z",
4839
5318
  fill: "#000"
4840
- }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
5319
+ }))), appearanceMode === 'week' ? /*#__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", {
5320
+ className: "e-cal-timeline__header__info"
5321
+ }, typeof appearanceWeekTmpl === 'function' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, appearanceWeekTmpl(displayWeekForHeader[0], displayWeekForHeader[1])) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, displayWeekForHeader[0], " - ", displayWeekForHeader[1]))) : null, appearanceMode === 'month' ? /*#__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", {
4841
5322
  className: "e-cal-timeline__header__btns"
4842
5323
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
4843
5324
  tabIndex: -1,
@@ -4863,7 +5344,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4863
5344
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
4864
5345
  d: "M11.178 19.569a.998.998 0 0 0 1.644 0l9-13A.999.999 0 0 0 21 5H3a1.002 1.002 0 0 0-.822 1.569l9 13z",
4865
5346
  fill: "#000000"
4866
- })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
5347
+ }))))) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
4867
5348
  tabIndex: -1,
4868
5349
  type: "button",
4869
5350
  className: "e-cal-timeline__btn e-cal-timeline__btn--next",
@@ -4913,9 +5394,25 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
4913
5394
  type: "button",
4914
5395
  className: "e-cal-timeline__btn e-cal-timeline__btn--today",
4915
5396
  onClick: handleTodayChange
4916
- }, langToday || 'Today'))), val.length === 0 ? null : /*#__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", {
5397
+ }, langToday || 'Today'), appearanceToggle ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
5398
+ tabIndex: -1,
5399
+ type: "button",
5400
+ className: "e-cal-timeline__btn e-cal-timeline__btn--appearance ".concat(appearanceMode === 'month' ? 'active' : ''),
5401
+ "data-mode": "month",
5402
+ onClick: handleAppearanceChange
5403
+ }, langAppearanceLabelMonth || 'Month'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
5404
+ tabIndex: -1,
5405
+ type: "button",
5406
+ className: "e-cal-timeline__btn e-cal-timeline__btn--appearance ".concat(appearanceMode === 'week' ? 'active' : ''),
5407
+ "data-mode": "week",
5408
+ onClick: handleAppearanceChange
5409
+ }, langAppearanceLabelWeek || 'Week')) : null)), val.length === 0 ? null : /*#__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", {
4917
5410
  ref: tableGridRef,
4918
- className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)("e-cal-timeline-table__timeline-table__wrapper invisible", tableWrapperClassName)
5411
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)("e-cal-timeline-table__timeline-table__wrapper e-cal-timeline-table__timeline-table__wrapper--".concat(appearanceMode, " invisible"), tableWrapperClassName),
5412
+ onKeyDown: function onKeyDown(e) {
5413
+ onKeyPressed === null || onKeyPressed === void 0 ? void 0 : onKeyPressed(e, selectedCells);
5414
+ },
5415
+ tabIndex: -1 // require "tabIndex" attribute
4919
5416
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("table", {
4920
5417
  role: "grid",
4921
5418
  className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_7__.combinedCls)("e-cal-timeline-table__timeline-table", tableClassName)
@@ -5004,6 +5501,9 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5004
5501
  className: "e-cal-timeline-table__timeline-body"
5005
5502
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("table", {
5006
5503
  className: "e-cal-timeline-table__datagrid-body__content e-cal-timeline-table__scrollgrid-sync-table"
5504
+ /* Drag to activate the selection area */,
5505
+ onMouseLeave: multipleCells ? handleTableMainMouseUp : undefined,
5506
+ onMouseUp: multipleCells ? handleTableMainMouseUp : undefined
5007
5507
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("colgroup", null, generateColUi()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tbody", null, val.map(function (item, i) {
5008
5508
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", {
5009
5509
  key: i
@@ -5024,15 +5524,14 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5024
5524
  }, 350);
5025
5525
  },
5026
5526
  onSubmit: /*#__PURE__*/function () {
5027
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, closewin, data) {
5527
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, closewin, data) {
5028
5528
  return _regeneratorRuntime().wrap(function _callee$(_context) {
5029
5529
  while (1) switch (_context.prev = _context.next) {
5030
5530
  case 0:
5031
5531
  onModalDeleteEvent === null || onModalDeleteEvent === void 0 ? void 0 : onModalDeleteEvent(queryItemObj(), closewin, function () {
5032
5532
  // initialize table grid
5033
5533
  setTimeout(function () {
5034
- tableGridReset(false);
5035
- tableGridInit(false);
5534
+ tableGridInitHeadertitle();
5036
5535
  }, 500);
5037
5536
  });
5038
5537
  case 1:
@@ -5042,7 +5541,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5042
5541
  }, _callee);
5043
5542
  }));
5044
5543
  return function (_x2, _x3, _x4) {
5045
- return _ref.apply(this, arguments);
5544
+ return _ref3.apply(this, arguments);
5046
5545
  };
5047
5546
  }()
5048
5547
  }, modalDeleteContent || 'Are you sure?'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_modaldialog__WEBPACK_IMPORTED_MODULE_2___default()), {
@@ -5064,15 +5563,14 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5064
5563
  }, 350);
5065
5564
  },
5066
5565
  onSubmit: /*#__PURE__*/function () {
5067
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, closewin, data) {
5566
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, closewin, data) {
5068
5567
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5069
5568
  while (1) switch (_context2.prev = _context2.next) {
5070
5569
  case 0:
5071
5570
  onModalEditEvent === null || onModalEditEvent === void 0 ? void 0 : onModalEditEvent(queryItemObj(), closewin, function () {
5072
5571
  // initialize table grid
5073
5572
  setTimeout(function () {
5074
- tableGridReset(false);
5075
- tableGridInit(false);
5573
+ tableGridInitHeadertitle();
5076
5574
  }, 500);
5077
5575
  });
5078
5576
  case 1:
@@ -5082,7 +5580,7 @@ var EventCalendarTimeline = function EventCalendarTimeline(props) {
5082
5580
  }, _callee2);
5083
5581
  }));
5084
5582
  return function (_x5, _x6, _x7) {
5085
- return _ref2.apply(this, arguments);
5583
+ return _ref4.apply(this, arguments);
5086
5584
  };
5087
5585
  }()
5088
5586
  }, modalContent)) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_root_portal__WEBPACK_IMPORTED_MODULE_1___default()), {