funda-ui 4.3.355 → 4.3.721

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 (49) hide show
  1. package/DynamicFields/index.d.ts +1 -0
  2. package/DynamicFields/index.js +23 -3
  3. package/EventCalendar/index.css +150 -106
  4. package/EventCalendar/index.d.ts +11 -2
  5. package/EventCalendar/index.js +835 -151
  6. package/EventCalendarTimeline/index.css +293 -251
  7. package/EventCalendarTimeline/index.d.ts +18 -9
  8. package/EventCalendarTimeline/index.js +1077 -505
  9. package/MultipleCheckboxes/index.d.ts +1 -0
  10. package/MultipleCheckboxes/index.js +17 -7
  11. package/MultipleSelect/index.d.ts +4 -0
  12. package/MultipleSelect/index.js +54 -8
  13. package/NativeSelect/index.js +1 -0
  14. package/Radio/index.d.ts +2 -1
  15. package/Radio/index.js +54 -24
  16. package/Select/index.js +115 -42
  17. package/Table/index.js +27 -3
  18. package/lib/cjs/DynamicFields/index.d.ts +1 -0
  19. package/lib/cjs/DynamicFields/index.js +23 -3
  20. package/lib/cjs/EventCalendar/index.d.ts +11 -2
  21. package/lib/cjs/EventCalendar/index.js +835 -151
  22. package/lib/cjs/EventCalendarTimeline/index.d.ts +18 -9
  23. package/lib/cjs/EventCalendarTimeline/index.js +1077 -505
  24. package/lib/cjs/MultipleCheckboxes/index.d.ts +1 -0
  25. package/lib/cjs/MultipleCheckboxes/index.js +17 -7
  26. package/lib/cjs/MultipleSelect/index.d.ts +4 -0
  27. package/lib/cjs/MultipleSelect/index.js +54 -8
  28. package/lib/cjs/NativeSelect/index.js +1 -0
  29. package/lib/cjs/Radio/index.d.ts +2 -1
  30. package/lib/cjs/Radio/index.js +54 -24
  31. package/lib/cjs/Select/index.js +115 -42
  32. package/lib/cjs/Table/index.js +27 -3
  33. package/lib/css/EventCalendar/index.css +150 -106
  34. package/lib/css/EventCalendarTimeline/index.css +293 -251
  35. package/lib/esm/DynamicFields/index.tsx +28 -3
  36. package/lib/esm/EventCalendar/index.scss +172 -104
  37. package/lib/esm/EventCalendar/index.tsx +272 -139
  38. package/lib/esm/EventCalendarTimeline/index.scss +275 -213
  39. package/lib/esm/EventCalendarTimeline/index.tsx +706 -708
  40. package/lib/esm/MultipleCheckboxes/index.tsx +18 -5
  41. package/lib/esm/MultipleSelect/ItemList.tsx +1 -0
  42. package/lib/esm/MultipleSelect/index.tsx +103 -52
  43. package/lib/esm/NativeSelect/index.tsx +2 -0
  44. package/lib/esm/Radio/index.tsx +68 -27
  45. package/lib/esm/Select/index.tsx +236 -65
  46. package/lib/esm/Table/Table.tsx +1 -0
  47. package/lib/esm/Table/TableCell.tsx +6 -0
  48. package/lib/esm/Table/table-utils/ToggleSelection.tsx +17 -2
  49. package/package.json +1 -1
@@ -2049,6 +2049,604 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2049
2049
 
2050
2050
  /***/ }),
2051
2051
 
2052
+ /***/ 322:
2053
+ /***/ (function(module, exports, __webpack_require__) {
2054
+
2055
+ /* module decorator */ module = __webpack_require__.nmd(module);
2056
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2057
+ (function webpackUniversalModuleDefinition(root, factory) {
2058
+ if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2059
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2060
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
2061
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
2062
+ })(this, function () {
2063
+ return (/******/function () {
2064
+ // webpackBootstrap
2065
+ /******/
2066
+ "use strict";
2067
+
2068
+ /******/ // The require scope
2069
+ /******/
2070
+ var __nested_webpack_require_987__ = {};
2071
+ /******/
2072
+ /************************************************************************/
2073
+ /******/ /* webpack/runtime/define property getters */
2074
+ /******/
2075
+ (function () {
2076
+ /******/ // define getter functions for harmony exports
2077
+ /******/__nested_webpack_require_987__.d = function (exports, definition) {
2078
+ /******/for (var key in definition) {
2079
+ /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
2080
+ /******/Object.defineProperty(exports, key, {
2081
+ enumerable: true,
2082
+ get: definition[key]
2083
+ });
2084
+ /******/
2085
+ }
2086
+ /******/
2087
+ }
2088
+ /******/
2089
+ };
2090
+ /******/
2091
+ })();
2092
+ /******/
2093
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2094
+ /******/
2095
+ (function () {
2096
+ /******/__nested_webpack_require_987__.o = function (obj, prop) {
2097
+ return Object.prototype.hasOwnProperty.call(obj, prop);
2098
+ };
2099
+ /******/
2100
+ })();
2101
+ /******/
2102
+ /******/ /* webpack/runtime/make namespace object */
2103
+ /******/
2104
+ (function () {
2105
+ /******/ // define __esModule on exports
2106
+ /******/__nested_webpack_require_987__.r = function (exports) {
2107
+ /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2108
+ /******/Object.defineProperty(exports, Symbol.toStringTag, {
2109
+ value: 'Module'
2110
+ });
2111
+ /******/
2112
+ }
2113
+ /******/
2114
+ Object.defineProperty(exports, '__esModule', {
2115
+ value: true
2116
+ });
2117
+ /******/
2118
+ };
2119
+ /******/
2120
+ })();
2121
+ /******/
2122
+ /************************************************************************/
2123
+ var __webpack_exports__ = {};
2124
+ __nested_webpack_require_987__.r(__webpack_exports__);
2125
+ /* harmony export */
2126
+ __nested_webpack_require_987__.d(__webpack_exports__, {
2127
+ /* harmony export */"dateFormat": function dateFormat() {
2128
+ return (/* binding */_dateFormat
2129
+ );
2130
+ },
2131
+ /* harmony export */"getCalendarDate": function getCalendarDate() {
2132
+ return (/* binding */_getCalendarDate
2133
+ );
2134
+ },
2135
+ /* harmony export */"getCurrentDate": function getCurrentDate() {
2136
+ return (/* binding */_getCurrentDate
2137
+ );
2138
+ },
2139
+ /* harmony export */"getCurrentDay": function getCurrentDay() {
2140
+ return (/* binding */_getCurrentDay
2141
+ );
2142
+ },
2143
+ /* harmony export */"getCurrentMonth": function getCurrentMonth() {
2144
+ return (/* binding */_getCurrentMonth
2145
+ );
2146
+ },
2147
+ /* harmony export */"getCurrentYear": function getCurrentYear() {
2148
+ return (/* binding */_getCurrentYear
2149
+ );
2150
+ },
2151
+ /* harmony export */"getFirstAndLastMonthDay": function getFirstAndLastMonthDay() {
2152
+ return (/* binding */_getFirstAndLastMonthDay
2153
+ );
2154
+ },
2155
+ /* harmony export */"getFullTime": function getFullTime() {
2156
+ return (/* binding */_getFullTime
2157
+ );
2158
+ },
2159
+ /* harmony export */"getLastDayInMonth": function getLastDayInMonth() {
2160
+ return (/* binding */_getLastDayInMonth
2161
+ );
2162
+ },
2163
+ /* harmony export */"getNextMonthDate": function getNextMonthDate() {
2164
+ return (/* binding */_getNextMonthDate
2165
+ );
2166
+ },
2167
+ /* harmony export */"getNextYearDate": function getNextYearDate() {
2168
+ return (/* binding */_getNextYearDate
2169
+ );
2170
+ },
2171
+ /* harmony export */"getNow": function getNow() {
2172
+ return (/* binding */_getNow
2173
+ );
2174
+ },
2175
+ /* harmony export */"getPrevMonthDate": function getPrevMonthDate() {
2176
+ return (/* binding */_getPrevMonthDate
2177
+ );
2178
+ },
2179
+ /* harmony export */"getPrevYearDate": function getPrevYearDate() {
2180
+ return (/* binding */_getPrevYearDate
2181
+ );
2182
+ },
2183
+ /* harmony export */"getSpecifiedDate": function getSpecifiedDate() {
2184
+ return (/* binding */_getSpecifiedDate
2185
+ );
2186
+ },
2187
+ /* harmony export */"getTodayDate": function getTodayDate() {
2188
+ return (/* binding */_getTodayDate
2189
+ );
2190
+ },
2191
+ /* harmony export */"getTomorrowDate": function getTomorrowDate() {
2192
+ return (/* binding */_getTomorrowDate
2193
+ );
2194
+ },
2195
+ /* harmony export */"getYesterdayDate": function getYesterdayDate() {
2196
+ return (/* binding */_getYesterdayDate
2197
+ );
2198
+ },
2199
+ /* harmony export */"isTimeString": function isTimeString() {
2200
+ return (/* binding */_isTimeString
2201
+ );
2202
+ },
2203
+ /* harmony export */"isValidDate": function isValidDate() {
2204
+ return (/* binding */_isValidDate
2205
+ );
2206
+ },
2207
+ /* harmony export */"isValidDay": function isValidDay() {
2208
+ return (/* binding */_isValidDay
2209
+ );
2210
+ },
2211
+ /* harmony export */"isValidHours": function isValidHours() {
2212
+ return (/* binding */_isValidHours
2213
+ );
2214
+ },
2215
+ /* harmony export */"isValidMinutesAndSeconds": function isValidMinutesAndSeconds() {
2216
+ return (/* binding */_isValidMinutesAndSeconds
2217
+ );
2218
+ },
2219
+ /* harmony export */"isValidMonth": function isValidMonth() {
2220
+ return (/* binding */_isValidMonth
2221
+ );
2222
+ },
2223
+ /* harmony export */"isValidYear": function isValidYear() {
2224
+ return (/* binding */_isValidYear
2225
+ );
2226
+ },
2227
+ /* harmony export */"padZero": function padZero() {
2228
+ return (/* binding */_padZero
2229
+ );
2230
+ },
2231
+ /* harmony export */"setDateDays": function setDateDays() {
2232
+ return (/* binding */_setDateDays
2233
+ );
2234
+ },
2235
+ /* harmony export */"setDateHours": function setDateHours() {
2236
+ return (/* binding */_setDateHours
2237
+ );
2238
+ },
2239
+ /* harmony export */"setDateMinutes": function setDateMinutes() {
2240
+ return (/* binding */_setDateMinutes
2241
+ );
2242
+ },
2243
+ /* harmony export */"timestampToDate": function timestampToDate() {
2244
+ return (/* binding */_timestampToDate
2245
+ );
2246
+ }
2247
+ /* harmony export */
2248
+ });
2249
+ /**
2250
+ * The check string contains only hours, minutes, and seconds
2251
+ * @returns {Boolean}
2252
+ */
2253
+ function _isTimeString(str) {
2254
+ // match "HH:mm:ss"
2255
+ var timePattern = /^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/;
2256
+ return timePattern.test(str);
2257
+ }
2258
+
2259
+ /**
2260
+ * Get now
2261
+ * @returns {Date} // Wed Apr 17 2024 14:31:36 GMT+0800 (China Standard Time)
2262
+ */
2263
+ var _getNow = function getNow() {
2264
+ return new Date(Date.now());
2265
+ };
2266
+
2267
+ /**
2268
+ * Zero Padding
2269
+ * @param {Number} num
2270
+ * @param {Boolean} padZeroEnabled
2271
+ * @returns {String} '01', '05', '12'
2272
+ */
2273
+ var _padZero = function padZero(num) {
2274
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2275
+ if (padZeroEnabled) {
2276
+ return num < 10 ? '0' + num : num.toString();
2277
+ } else {
2278
+ return num.toString();
2279
+ }
2280
+ };
2281
+
2282
+ /**
2283
+ * Hours validation
2284
+ * @param {*} v
2285
+ * @returns {Boolean}
2286
+ */
2287
+ var _isValidHours = function isValidHours(v) {
2288
+ return /^([01]?[0-9]|2[0-3])$/.test(v); // 0~23, 00~23
2289
+ };
2290
+
2291
+ /**
2292
+ * Minutes and Seconds validation
2293
+ * @param {*} v
2294
+ * @returns {Boolean}
2295
+ */
2296
+ var _isValidMinutesAndSeconds = function isValidMinutesAndSeconds(v) {
2297
+ return /^([01]?[0-9]|[0-5][0-9])$/.test(v); // 0~59, 00~59
2298
+ };
2299
+
2300
+ /**
2301
+ * Year validation
2302
+ * @param {*} v
2303
+ * @returns {Boolean}
2304
+ */
2305
+ var _isValidYear = function isValidYear(v) {
2306
+ return /^([1-9][0-9])\d{2}$/.test(v); // 1000 ~ 9999
2307
+ };
2308
+
2309
+ /**
2310
+ * Month validation
2311
+ * @param {*} v
2312
+ * @returns {Boolean}
2313
+ */
2314
+ var _isValidMonth = function isValidMonth(v) {
2315
+ return /^(0?[1-9]|1[0-2])$/.test(v); // 01~12, 1~12
2316
+ };
2317
+
2318
+ /**
2319
+ * Day validation
2320
+ * @param {*} v
2321
+ * @returns {Boolean}
2322
+ */
2323
+ var _isValidDay = function isValidDay(v) {
2324
+ return /^(0?[1-9]|[1-2][0-9]|3[0-1])$/.test(v); // 01~31, 1~31
2325
+ };
2326
+
2327
+ /**
2328
+ * Check if the string is legitimate
2329
+ * @param {String} v
2330
+ * @returns {Boolean}
2331
+ */
2332
+ var _isValidDate = function isValidDate(v) {
2333
+ return !(String(new Date(v)).toLowerCase() === 'invalid date');
2334
+ };
2335
+
2336
+ /**
2337
+ * Get calendar date
2338
+ * @param {Date | String} v
2339
+ * @returns {Date | String} yyyy-MM-dd
2340
+ */
2341
+ function _dateFormat(v) {
2342
+ var date = typeof v === 'string' ? new Date(v.replace(/-/g, "/")) : v; // fix "Invalid date in safari"
2343
+ return date;
2344
+ }
2345
+
2346
+ /**
2347
+ * Get calendar date
2348
+ * @param {Date | String} v
2349
+ * @param {Boolean} padZeroEnabled
2350
+ * @returns {String} yyyy-MM-dd
2351
+ */
2352
+ function _getCalendarDate(v) {
2353
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2354
+ var date = _dateFormat(v);
2355
+ var year = date.getFullYear();
2356
+ var month = _padZero(date.getMonth() + 1, padZeroEnabled);
2357
+ var day = _padZero(date.getDate(), padZeroEnabled);
2358
+ var hours = _padZero(date.getHours(), padZeroEnabled);
2359
+ var minutes = _padZero(date.getMinutes(), padZeroEnabled);
2360
+ var seconds = _padZero(date.getSeconds(), padZeroEnabled);
2361
+ var res = "".concat(year, "-").concat(month, "-").concat(day);
2362
+ return res;
2363
+ }
2364
+
2365
+ /**
2366
+ * Get today date
2367
+ * @returns {String} yyyy-MM-dd
2368
+ */
2369
+ function _getTodayDate() {
2370
+ return _getCalendarDate(new Date());
2371
+ }
2372
+
2373
+ /**
2374
+ * Get tomorrow date
2375
+ * @param {Date | String} v
2376
+ * @returns {String} yyyy-MM-dd
2377
+ */
2378
+ function _getTomorrowDate(v) {
2379
+ var today = _dateFormat(v);
2380
+ var _tomorrow = today;
2381
+ _tomorrow.setDate(_tomorrow.getDate() + 1);
2382
+ var tomorrow = _getCalendarDate(_tomorrow);
2383
+ return tomorrow;
2384
+ }
2385
+
2386
+ /**
2387
+ * Get yesterday date
2388
+ * @param {Date | String} v
2389
+ * @returns {String} yyyy-MM-dd
2390
+ */
2391
+ function _getYesterdayDate(v) {
2392
+ var today = _dateFormat(v);
2393
+ var _yesterday = today;
2394
+ _yesterday.setDate(_yesterday.getDate() - 1);
2395
+ var yesterday = _getCalendarDate(_yesterday);
2396
+ return yesterday;
2397
+ }
2398
+
2399
+ /**
2400
+ * Get specified date
2401
+ * @param {Date | String} v
2402
+ * @param {Number} days The number of days forward or backward, which can be a negative number
2403
+ * @returns {String} yyyy-MM-dd
2404
+ */
2405
+ /* console.log(getSpecifiedDate(getTodayDate(), -180)); // 2023-08-27 (180 days before February 23, 202) */
2406
+ function _getSpecifiedDate(v, days) {
2407
+ var today = _dateFormat(v);
2408
+ var _specifiedDay = today;
2409
+ _specifiedDay.setDate(_specifiedDay.getDate() + days);
2410
+ var specifiedDay = _getCalendarDate(_specifiedDay);
2411
+ return specifiedDay;
2412
+ }
2413
+
2414
+ /**
2415
+ * Get next month date
2416
+ * @param {Date | String} v
2417
+ * @returns {String} yyyy-MM-dd
2418
+ */
2419
+ function _getNextMonthDate(v) {
2420
+ var today = _dateFormat(v);
2421
+ today.setMonth(today.getMonth() + 1);
2422
+ return _getCalendarDate(today);
2423
+ }
2424
+
2425
+ /**
2426
+ * Get previous month date
2427
+ * @param {Date | String} v
2428
+ * @returns {String} yyyy-MM-dd
2429
+ */
2430
+ function _getPrevMonthDate(v) {
2431
+ var today = _dateFormat(v);
2432
+ today.setMonth(today.getMonth() - 1);
2433
+ return _getCalendarDate(today);
2434
+ }
2435
+
2436
+ /**
2437
+ * Get next year date
2438
+ * @param {Date | String} v
2439
+ * @returns {String} yyyy-MM-dd
2440
+ */
2441
+ function _getNextYearDate(v) {
2442
+ var today = _dateFormat(v);
2443
+ var current = new Date(today);
2444
+ current.setFullYear(current.getFullYear() + 1);
2445
+ return _getCalendarDate(current);
2446
+ }
2447
+
2448
+ /**
2449
+ * Get previous year date
2450
+ * @param {Date | String} v
2451
+ * @returns {String} yyyy-MM-dd
2452
+ */
2453
+ function _getPrevYearDate(v) {
2454
+ var today = _dateFormat(v);
2455
+ var current = new Date(today);
2456
+ current.setFullYear(current.getFullYear() - 1);
2457
+ return _getCalendarDate(current);
2458
+ }
2459
+
2460
+ /**
2461
+ * Get last day in month
2462
+ * @param {Date | String} v
2463
+ * @param {?Number} targetMonth
2464
+ * @returns {String | Number} yyyy-MM-dd
2465
+ */
2466
+ /*
2467
+ Example: Get last day in next month
2468
+
2469
+ const _day = '2024-01-01';
2470
+ const y = new Date(getNextMonthDate(_day)).getFullYear();
2471
+ const m = String(new Date(getNextMonthDate(_day)).getMonth() + 1).padStart(2, '0');
2472
+ const d = getLastDayInMonth(getNextMonthDate(_day), new Date(getNextMonthDate(_day)).getMonth() + 1);
2473
+
2474
+ const lastDayOfNextMonth = `${y}-${m}-${d}`; // 2024-02-29
2475
+
2476
+ */
2477
+ function _getLastDayInMonth(v) {
2478
+ var targetMonth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
2479
+ var date = _dateFormat(v);
2480
+ return new Date(date.getFullYear(), typeof targetMonth !== 'undefined' ? targetMonth : date.getMonth() - 1, 0).getDate();
2481
+ }
2482
+
2483
+ /**
2484
+ * Get current year
2485
+ * @returns {Number}
2486
+ */
2487
+ function _getCurrentYear() {
2488
+ return new Date().getFullYear();
2489
+ }
2490
+
2491
+ /**
2492
+ * Get current month
2493
+ * @param {Boolean} padZeroEnabled
2494
+ * @returns {Number}
2495
+ */
2496
+ function _getCurrentMonth() {
2497
+ var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
2498
+ var m = new Date().getMonth() + 1;
2499
+ return padZeroEnabled ? String(m).padStart(2, '0') : m;
2500
+ }
2501
+
2502
+ /**
2503
+ * Get current day
2504
+ * @param {Boolean} padZeroEnabled
2505
+ * @returns {Number}
2506
+ */
2507
+ function _getCurrentDay() {
2508
+ var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
2509
+ var d = new Date().getDate();
2510
+ return padZeroEnabled ? String(d).padStart(2, '0') : d;
2511
+ }
2512
+
2513
+ /**
2514
+ * Get first and last month day
2515
+ * @param {Number} v
2516
+ * @param {Boolean} padZeroEnabled
2517
+ * @returns {Array}
2518
+ */
2519
+ function _getFirstAndLastMonthDay(year) {
2520
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2521
+ var theFirst = new Date(year, 0, 1).getDate();
2522
+ var theLast = new Date(year, 11, 31).getDate();
2523
+ var padZero = function padZero(num) {
2524
+ if (padZeroEnabled) {
2525
+ return num < 10 ? '0' + num : num.toString();
2526
+ } else {
2527
+ return num.toString();
2528
+ }
2529
+ };
2530
+ return [padZero(theFirst), padZero(theLast)];
2531
+ }
2532
+
2533
+ /**
2534
+ * Get current date
2535
+ * @param {Boolean} padZeroEnabled
2536
+ * @typedef {String} JSON
2537
+ */
2538
+ function _getCurrentDate() {
2539
+ var padZeroEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
2540
+ var date = new Date();
2541
+ var padZero = function padZero(num) {
2542
+ if (padZeroEnabled) {
2543
+ return num < 10 ? '0' + num : num.toString();
2544
+ } else {
2545
+ return num.toString();
2546
+ }
2547
+ };
2548
+ var year = date.getFullYear();
2549
+ var month = padZero(date.getMonth() + 1);
2550
+ var day = padZero(date.getDate());
2551
+ var hours = padZero(date.getHours());
2552
+ var minutes = padZero(date.getMinutes());
2553
+ return {
2554
+ today: "".concat(year, "-").concat(month, "-").concat(day),
2555
+ yearStart: "".concat(year, "-01-01"),
2556
+ yearEnd: "".concat(year, "-12-").concat(_getLastDayInMonth(date, 12))
2557
+ };
2558
+ }
2559
+
2560
+ /**
2561
+ * Get full time
2562
+ * @param {Date | String} v
2563
+ * @param {Boolean} padZeroEnabled
2564
+ * @param {Boolean} hasSeconds
2565
+ * @returns {String} yyyy-MM-dd HH:mm:ss
2566
+ */
2567
+ function _getFullTime(v) {
2568
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2569
+ var hasSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2570
+ var date = _dateFormat(v);
2571
+ var padZero = function padZero(num) {
2572
+ if (padZeroEnabled) {
2573
+ return num < 10 ? '0' + num : num.toString();
2574
+ } else {
2575
+ return num.toString();
2576
+ }
2577
+ };
2578
+ var year = date.getFullYear();
2579
+ var month = padZero(date.getMonth() + 1);
2580
+ var day = padZero(date.getDate());
2581
+ var hours = padZero(date.getHours());
2582
+ var minutes = padZero(date.getMinutes());
2583
+ var seconds = padZero(date.getSeconds());
2584
+ var res = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes, ":").concat(seconds);
2585
+ var res2 = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes);
2586
+ return hasSeconds ? res : res2;
2587
+ }
2588
+
2589
+ /**
2590
+ * Add hours
2591
+ * @param {Date | String} v
2592
+ * @param {Number} offset
2593
+ * @param {Boolean} padZeroEnabled
2594
+ * @returns {String} yyyy-MM-dd HH:mm:ss
2595
+ */
2596
+ function _setDateHours(v, offset) {
2597
+ var padZeroEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2598
+ var date = _dateFormat(v);
2599
+ var _cur = new Date(date).setTime(new Date(date).getTime() + offset * 60 * 60 * 1000);
2600
+ return _getFullTime(new Date(_cur), padZeroEnabled);
2601
+ }
2602
+
2603
+ /**
2604
+ * Add minutes
2605
+ * @param {Date | String} v
2606
+ * @param {Number} offset
2607
+ * @param {Boolean} padZeroEnabled
2608
+ * @returns {String} yyyy-MM-dd HH:mm:ss
2609
+ */
2610
+ function _setDateMinutes(v, offset) {
2611
+ var padZeroEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2612
+ var date = _dateFormat(v);
2613
+ var _cur = new Date(date).setTime(new Date(date).getTime() + offset * 60 * 1000);
2614
+ return _getFullTime(new Date(_cur), padZeroEnabled);
2615
+ }
2616
+ /**
2617
+ * Add days
2618
+ * @param {Date | String} v
2619
+ * @param {Number} offset
2620
+ * @param {Boolean} padZeroEnabled
2621
+ * @returns {String} yyyy-MM-dd HH:mm:ss
2622
+ */
2623
+ function _setDateDays(v, offset) {
2624
+ var padZeroEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2625
+ var date = _dateFormat(v);
2626
+ var _cur = new Date(date).setTime(new Date(date).getTime() + offset * 24 * 60 * 60 * 1000);
2627
+ return _getFullTime(new Date(_cur), padZeroEnabled);
2628
+ }
2629
+
2630
+ /**
2631
+ * Convert timestamp to date
2632
+ * @param {Number} v
2633
+ * @param {Boolean} padZeroEnabled
2634
+ * @returns {String} yyyy-MM-dd HH:mm:ss
2635
+ */
2636
+ function _timestampToDate(v) {
2637
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2638
+ return _getFullTime(new Date(v), padZeroEnabled);
2639
+ }
2640
+
2641
+ /******/
2642
+ return __webpack_exports__;
2643
+ /******/
2644
+ }()
2645
+ );
2646
+ });
2647
+
2648
+ /***/ }),
2649
+
2052
2650
  /***/ 787:
2053
2651
  /***/ ((module) => {
2054
2652
 
@@ -2155,10 +2753,12 @@ __webpack_require__.r(__webpack_exports__);
2155
2753
  /* harmony export */ });
2156
2754
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
2157
2755
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2158
- /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(188);
2159
- /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_1__);
2160
- /* harmony import */ var funda_modaldialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(483);
2161
- /* harmony import */ var funda_modaldialog__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(funda_modaldialog__WEBPACK_IMPORTED_MODULE_2__);
2756
+ /* harmony import */ var funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(322);
2757
+ /* harmony import */ var funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__);
2758
+ /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(188);
2759
+ /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__);
2760
+ /* harmony import */ var funda_modaldialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(483);
2761
+ /* harmony import */ var funda_modaldialog__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(funda_modaldialog__WEBPACK_IMPORTED_MODULE_3__);
2162
2762
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2163
2763
  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; }
2164
2764
  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); } }
@@ -2176,8 +2776,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2176
2776
 
2177
2777
 
2178
2778
 
2779
+
2179
2780
  var EventCalendar = function EventCalendar(props) {
2180
- var calendarWrapperClassName = props.calendarWrapperClassName,
2781
+ var contentRef = props.contentRef,
2782
+ calendarWrapperClassName = props.calendarWrapperClassName,
2181
2783
  customTodayDate = props.customTodayDate,
2182
2784
  eventsValue = props.eventsValue,
2183
2785
  langWeek = props.langWeek,
@@ -2185,14 +2787,17 @@ var EventCalendar = function EventCalendar(props) {
2185
2787
  langMonths = props.langMonths,
2186
2788
  langMonthsFull = props.langMonthsFull,
2187
2789
  langToday = props.langToday,
2188
- iconRemove = props.iconRemove,
2189
2790
  onChangeDate = props.onChangeDate,
2190
2791
  onChangeMonth = props.onChangeMonth,
2191
2792
  onChangeYear = props.onChangeYear,
2192
2793
  onChangeToday = props.onChangeToday,
2193
2794
  onListRenderComplete = props.onListRenderComplete,
2795
+ iconRemove = props.iconRemove,
2796
+ iconAdd = props.iconAdd,
2194
2797
  cellCloseBtnClassName = props.cellCloseBtnClassName,
2195
2798
  cellCloseBtnLabel = props.cellCloseBtnLabel,
2799
+ cellAddBtnClassName = props.cellAddBtnClassName,
2800
+ cellAddBtnLabel = props.cellAddBtnLabel,
2196
2801
  modalMaskOpacity = props.modalMaskOpacity,
2197
2802
  modalMaxWidth = props.modalMaxWidth,
2198
2803
  modalMinHeight = props.modalMinHeight,
@@ -2275,6 +2880,7 @@ var EventCalendar = function EventCalendar(props) {
2275
2880
 
2276
2881
  // modal dialog
2277
2882
  var EVENTS_ENABLED = typeof modalContent !== 'undefined';
2883
+ var EVENTS_DELETE_ENABLED = typeof modalDeleteContent !== 'undefined';
2278
2884
  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
2279
2885
  _useState24 = _slicedToArray(_useState23, 2),
2280
2886
  showEdit = _useState24[0],
@@ -2283,23 +2889,76 @@ var EventCalendar = function EventCalendar(props) {
2283
2889
  _useState26 = _slicedToArray(_useState25, 2),
2284
2890
  showDelete = _useState26[0],
2285
2891
  setShowDelete = _useState26[1];
2286
- var padZero = function padZero(num) {
2287
- var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2288
- if (padZeroEnabled) {
2289
- return num < 10 ? '0' + num : num.toString();
2290
- } else {
2291
- return num.toString();
2292
- }
2293
- };
2294
- var isValidDate = function isValidDate(v) {
2295
- return !(String(new window.Date(v)).toLowerCase() === 'invalid date');
2892
+
2893
+ // Open temporary storage for pop-ups
2894
+ var _useState27 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(-1),
2895
+ _useState28 = _slicedToArray(_useState27, 2),
2896
+ tableCellId = _useState28[0],
2897
+ setTableCellId = _useState28[1];
2898
+
2899
+ // exposes the following methods
2900
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(contentRef, function () {
2901
+ return {
2902
+ gridInit: function gridInit() {},
2903
+ gridReset: function gridReset(cb) {}
2904
+ };
2905
+ }, [contentRef]);
2906
+
2907
+ // helper buttons
2908
+ var _delBtn = function _delBtn() {
2909
+ 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", {
2910
+ width: "20px",
2911
+ height: "20px",
2912
+ viewBox: "0 0 24 24",
2913
+ fill: "none"
2914
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
2915
+ fillRule: "evenodd",
2916
+ clipRule: "evenodd",
2917
+ d: "M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10ZM8 11a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Z",
2918
+ fill: "#000"
2919
+ }))), cellCloseBtnLabel || '');
2296
2920
  };
2297
- var dateFormat = function dateFormat(v) {
2298
- var date = typeof v === 'string' ? new window.Date(v.replace(/-/g, "/")) : v; // fix "Invalid date in safari"
2299
- return date;
2921
+ var _addBtn = function _addBtn() {
2922
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, iconAdd ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, iconAdd) : /*#__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", {
2923
+ width: "20px",
2924
+ height: "20px",
2925
+ viewBox: "0 0 32 32"
2926
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", {
2927
+ stroke: "none",
2928
+ strokeWidth: "1",
2929
+ fill: "none",
2930
+ fillRule: "evenodd"
2931
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", {
2932
+ transform: "translate(-102.000000, -1037.000000)",
2933
+ fill: "#000000"
2934
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
2935
+ d: "M124,1054 L119,1054 L119,1059 C119,1059.55 118.552,1060 118,1060 C117.448,1060 117,1059.55 117,1059 L117,1054 L112,1054 C111.448,1054 111,1053.55 111,1053 C111,1052.45 111.448,1052 112,1052 L117,1052 L117,1047 C117,1046.45 117.448,1046 118,1046 C118.552,1046 119,1046.45 119,1047 L119,1052 L124,1052 C124.552,1052 125,1052.45 125,1053 C125,1053.55 124.552,1054 124,1054 L124,1054 Z M130,1037 L106,1037 C103.791,1037 102,1038.79 102,1041 L102,1065 C102,1067.21 103.791,1069 106,1069 L130,1069 C132.209,1069 134,1067.21 134,1065 L134,1041 C134,1038.79 132.209,1037 130,1037 L130,1037 Z"
2936
+ }))))), cellAddBtnLabel || '');
2300
2937
  };
2301
- var getTodayDate = function getTodayDate() {
2302
- return getCalendarDate(new Date());
2938
+ var queryItemObj = function queryItemObj() {
2939
+ var _perData = val.filter(function (item) {
2940
+ return (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)(item.date) === (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(day));
2941
+ });
2942
+ var _currentData = undefined;
2943
+ if (_perData[0]) {
2944
+ var _items = _perData[0].list;
2945
+ if (tableCellId === -1) {
2946
+ // add new
2947
+ _currentData = {
2948
+ id: 0,
2949
+ date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(day))
2950
+ };
2951
+ } else {
2952
+ // edit or delete
2953
+ _currentData = _items.filter(function (item) {
2954
+ return item.id == tableCellId;
2955
+ })[0];
2956
+ }
2957
+ }
2958
+ return _perData[0] ? _currentData : {
2959
+ id: 0,
2960
+ date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(day))
2961
+ };
2303
2962
  };
2304
2963
 
2305
2964
  // cell
@@ -2379,27 +3038,6 @@ var EventCalendar = function EventCalendar(props) {
2379
3038
  return [];
2380
3039
  }
2381
3040
  };
2382
- function getCalendarDate(v) {
2383
- var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2384
- if (typeof v === 'undefined') return '';
2385
-
2386
- // yyyy-MM-dd
2387
- var date = typeof v === 'string' ? new Date(v.replace(/-/g, "/")) : v; // fix "Invalid date in safari"
2388
- var padZero = function padZero(num) {
2389
- if (padZeroEnabled) {
2390
- return num < 10 ? '0' + num : num.toString();
2391
- } else {
2392
- return num.toString();
2393
- }
2394
- };
2395
- var year = date.getFullYear();
2396
- var month = padZero(date.getMonth() + 1);
2397
- var day = padZero(date.getDate());
2398
- var hours = padZero(date.getHours());
2399
- var minutes = padZero(date.getMinutes());
2400
- var res = "".concat(year, "-").concat(month, "-").concat(day);
2401
- return res;
2402
- }
2403
3041
  function setTodayDate(inputDate) {
2404
3042
  setDay(inputDate.getDate());
2405
3043
  setMonth(inputDate.getMonth());
@@ -2428,8 +3066,8 @@ var EventCalendar = function EventCalendar(props) {
2428
3066
 
2429
3067
  //
2430
3068
  onChangeMonth === null || onChangeMonth === void 0 ? void 0 : onChangeMonth({
2431
- day: padZero(day),
2432
- month: padZero(_date.getMonth() + 1),
3069
+ day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(day),
3070
+ month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(_date.getMonth() + 1),
2433
3071
  year: _date.getFullYear().toString()
2434
3072
  });
2435
3073
  return _date;
@@ -2445,8 +3083,8 @@ var EventCalendar = function EventCalendar(props) {
2445
3083
 
2446
3084
  //
2447
3085
  onChangeMonth === null || onChangeMonth === void 0 ? void 0 : onChangeMonth({
2448
- day: padZero(day),
2449
- month: padZero(_date.getMonth() + 1),
3086
+ day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(day),
3087
+ month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(_date.getMonth() + 1),
2450
3088
  year: _date.getFullYear().toString()
2451
3089
  });
2452
3090
  return _date;
@@ -2473,8 +3111,8 @@ var EventCalendar = function EventCalendar(props) {
2473
3111
 
2474
3112
  //
2475
3113
  onChangeMonth === null || onChangeMonth === void 0 ? void 0 : onChangeMonth({
2476
- day: padZero(day),
2477
- month: padZero(currentIndex + 1),
3114
+ day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(day),
3115
+ month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(currentIndex + 1),
2478
3116
  year: year.toString()
2479
3117
  });
2480
3118
  }
@@ -2484,7 +3122,7 @@ var EventCalendar = function EventCalendar(props) {
2484
3122
  setTodayDate(now);
2485
3123
 
2486
3124
  //
2487
- var _now = getTodayDate().split('-');
3125
+ var _now = (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getTodayDate)().split('-');
2488
3126
  onChangeToday === null || onChangeToday === void 0 ? void 0 : onChangeToday({
2489
3127
  day: _now[2],
2490
3128
  month: _now[1],
@@ -2513,8 +3151,8 @@ var EventCalendar = function EventCalendar(props) {
2513
3151
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2514
3152
  // Guaranteed year change triggered by the front and rear buttons
2515
3153
  onChangeYear === null || onChangeYear === void 0 ? void 0 : onChangeYear({
2516
- day: padZero(day),
2517
- month: padZero(month + 1),
3154
+ day: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(day),
3155
+ month: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(month + 1),
2518
3156
  year: year.toString()
2519
3157
  });
2520
3158
  }, [year]);
@@ -2526,7 +3164,7 @@ var EventCalendar = function EventCalendar(props) {
2526
3164
  if (Array.isArray(eventsValue)) setVal(eventsValue);
2527
3165
 
2528
3166
  // update current today
2529
- if (typeof customTodayDate === 'string' && customTodayDate !== '' && isValidDate(customTodayDate)) {
3167
+ if (typeof customTodayDate === 'string' && customTodayDate !== '' && (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.isValidDate)(customTodayDate)) {
2530
3168
  var _customNow = new Date(customTodayDate);
2531
3169
  setTodayDate(_customNow);
2532
3170
  }
@@ -2535,13 +3173,13 @@ var EventCalendar = function EventCalendar(props) {
2535
3173
  onListRenderComplete === null || onListRenderComplete === void 0 ? void 0 : onListRenderComplete();
2536
3174
  }, [eventsValue, customTodayDate]);
2537
3175
  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", {
2538
- className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_1__.combinedCls)("e-cal__wrapper", calendarWrapperClassName)
3176
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)("e-cal-normal__wrapper", calendarWrapperClassName)
2539
3177
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2540
- className: "e-cal__header bg-body-tertiary"
3178
+ className: "e-cal-normal__header bg-body-tertiary"
2541
3179
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
2542
3180
  tabIndex: -1,
2543
3181
  type: "button",
2544
- className: "e-cal__btn e-cal__btn--prev",
3182
+ className: "e-cal-normal__btn e-cal-normal__btn--prev",
2545
3183
  onClick: handlePrevChange
2546
3184
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
2547
3185
  width: "20px",
@@ -2552,11 +3190,11 @@ var EventCalendar = function EventCalendar(props) {
2552
3190
  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",
2553
3191
  fill: "#000"
2554
3192
  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2555
- className: "e-cal__header__btns"
3193
+ className: "e-cal-normal__header__btns"
2556
3194
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
2557
3195
  tabIndex: -1,
2558
3196
  type: "button",
2559
- className: "e-cal__btn ".concat(winMonth ? 'active' : ''),
3197
+ className: "e-cal-normal__btn ".concat(winMonth ? 'active' : ''),
2560
3198
  onClick: handleShowWinMonth
2561
3199
  }, MONTHS[month], /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
2562
3200
  width: "12px",
@@ -2568,7 +3206,7 @@ var EventCalendar = function EventCalendar(props) {
2568
3206
  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
2569
3207
  tabIndex: -1,
2570
3208
  type: "button",
2571
- className: "e-cal__btn ".concat(winYear ? 'active' : ''),
3209
+ className: "e-cal-normal__btn ".concat(winYear ? 'active' : ''),
2572
3210
  onClick: handleShowWinYear
2573
3211
  }, year, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
2574
3212
  width: "12px",
@@ -2580,7 +3218,7 @@ var EventCalendar = function EventCalendar(props) {
2580
3218
  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
2581
3219
  tabIndex: -1,
2582
3220
  type: "button",
2583
- className: "e-cal__btn e-cal__btn--next",
3221
+ className: "e-cal-normal__btn e-cal-normal__btn--next",
2584
3222
  onClick: handleNextChange
2585
3223
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
2586
3224
  width: "20px",
@@ -2591,12 +3229,12 @@ var EventCalendar = function EventCalendar(props) {
2591
3229
  d: "M9.71069 18.2929C10.1012 18.6834 10.7344 18.6834 11.1249 18.2929L16.0123 13.4006C16.7927 12.6195 16.7924 11.3537 16.0117 10.5729L11.1213 5.68254C10.7308 5.29202 10.0976 5.29202 9.70708 5.68254C9.31655 6.07307 9.31655 6.70623 9.70708 7.09676L13.8927 11.2824C14.2833 11.6729 14.2833 12.3061 13.8927 12.6966L9.71069 16.8787C9.32016 17.2692 9.32016 17.9023 9.71069 18.2929Z",
2592
3230
  fill: "#000"
2593
3231
  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2594
- className: "e-cal__body"
3232
+ className: "e-cal-normal__body"
2595
3233
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2596
- className: "e-cal__row"
3234
+ className: "e-cal-normal__row"
2597
3235
  }, WEEK.map(function (s, i) {
2598
3236
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2599
- className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_1__.combinedCls)('e-cal__cell e-cal__day e-cal__day--week e-cal__day--disabled bg-secondary-subtle empty', {
3237
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)('e-cal-normal__cell e-cal-normal__day e-cal-normal__day--week e-cal-normal__day--disabled bg-secondary-subtle empty', {
2600
3238
  'last-cell': i === WEEK.length - 1
2601
3239
  }),
2602
3240
  key: i,
@@ -2616,32 +3254,112 @@ var EventCalendar = function EventCalendar(props) {
2616
3254
  var __backFillNum = getBackFill();
2617
3255
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2618
3256
  key: 'row' + item.row,
2619
- className: "e-cal__row"
3257
+ className: "e-cal-normal__row"
2620
3258
  }, item.col.map(function (dayIndex, i) {
2621
3259
  var d = typeof dayIndex === 'number' ? dayIndex - (startDay - 2) : 0;
2622
3260
  var _currentData = val.filter(function (item) {
2623
- return getCalendarDate(item.date) === getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(d));
3261
+ return (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)(item.date) === (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d));
2624
3262
  });
2625
3263
  var isLastCol = i === item.col.length - 1;
2626
3264
 
2627
3265
  // date
2628
3266
  var _dateShow = d > 0 ? "".concat(year, "-").concat(month + 1, "-").concat(d) : '';
2629
- if (isFirstRow && __forwardFillNum && _dateShow === '') {
3267
+ var isForward = isFirstRow && __forwardFillNum && typeof __forwardFillNum[i] !== 'undefined';
3268
+ var isBack = isLastRow && __backFillNum && typeof __backFillNum[i - item.col.filter(Boolean).length] !== 'undefined';
3269
+ if (isForward && _dateShow === '') {
2630
3270
  if (month + 1 === 1) {
2631
3271
  _dateShow = "".concat(year - 1, "-12-").concat(__forwardFillNum[i]);
2632
3272
  } else {
2633
3273
  _dateShow = "".concat(year, "-").concat(month, "-").concat(__forwardFillNum[i]);
2634
3274
  }
2635
3275
  }
2636
- if (isLastRow && __backFillNum && _dateShow === '') {
3276
+ if (isBack && _dateShow === '') {
2637
3277
  if (month + 1 === 12) {
2638
3278
  _dateShow = "".concat(year + 1, "-1-").concat(__backFillNum[i - item.col.filter(Boolean).length]);
2639
3279
  } else {
2640
3280
  _dateShow = "".concat(year, "-").concat(month + 2, "-").concat(__backFillNum[i - item.col.filter(Boolean).length]);
2641
3281
  }
2642
3282
  }
3283
+ var _eventContent = function _eventContent() {
3284
+ if (_currentData.length === 0 || !Array.isArray(_currentData) || typeof _currentData[0].list === 'undefined') {
3285
+ return null;
3286
+ }
3287
+
3288
+ //
3289
+ var _items = _currentData[0].list;
3290
+ return _items.map(function (cellItem, cellItemIndex) {
3291
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
3292
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)("e-cal-normal__cell-item e-cal-normal__cell-item-".concat(cellItemIndex), {
3293
+ 'first': cellItemIndex === 0,
3294
+ 'last': cellItemIndex === _items.length - 1
3295
+ }),
3296
+ key: "cell-item-".concat(cellItemIndex, "}"),
3297
+ "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)(_dateShow),
3298
+ "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(d),
3299
+ "data-week": i,
3300
+ onClick: function onClick(e) {
3301
+ var _cellItem$callback;
3302
+ e.stopPropagation();
3303
+
3304
+ // update cell data
3305
+ setTableCellId(cellItem.id);
3306
+
3307
+ // Callback
3308
+ (_cellItem$callback = cellItem.callback) === null || _cellItem$callback === void 0 ? void 0 : _cellItem$callback.call(cellItem);
3309
+ if (d > 0) {
3310
+ handleDayChange(e, d); // update current day
3311
+
3312
+ onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, cellItem);
3313
+ if (EVENTS_ENABLED) {
3314
+ onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(cellItem, function () {
3315
+ return setShowEdit(true);
3316
+ }, 'normal');
3317
+ }
3318
+ }
3319
+ }
3320
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
3321
+ className: "e-cal-normal__day__event",
3322
+ style: typeof cellItem !== 'undefined' && cellItem.eventStyles !== 'undefined' ? cellItem.eventStyles : {},
3323
+ dangerouslySetInnerHTML: {
3324
+ __html: cellItem.data
3325
+ }
3326
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
3327
+ className: "e-cal-normal__day__eventdel ".concat(cellCloseBtnClassName || '')
3328
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
3329
+ href: "#",
3330
+ tabIndex: -1,
3331
+ className: "align-middle",
3332
+ "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)(_dateShow),
3333
+ "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(d),
3334
+ "data-week": i,
3335
+ onClick: function onClick(e) {
3336
+ e.preventDefault();
3337
+ e.stopPropagation();
3338
+
3339
+ // update cell data
3340
+ setTableCellId(cellItem.id);
3341
+ var _existsContent = cellItem;
3342
+
3343
+ //
3344
+ if (d > 0) {
3345
+ handleDayChange(e, d); // update current day
3346
+
3347
+ onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
3348
+ id: 0,
3349
+ date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
3350
+ });
3351
+ if (EVENTS_DELETE_ENABLED) {
3352
+ onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_existsContent, function () {
3353
+ return setShowDelete(true);
3354
+ });
3355
+ }
3356
+ }
3357
+ }
3358
+ }, _delBtn())));
3359
+ });
3360
+ };
2643
3361
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2644
- className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_1__.combinedCls)('e-cal__cell e-cal__day', {
3362
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)('e-cal-normal__cell e-cal-normal__day', {
2645
3363
  'empty': d <= 0,
2646
3364
  'today': d === now.getDate(),
2647
3365
  'selected': d === day,
@@ -2649,8 +3367,8 @@ var EventCalendar = function EventCalendar(props) {
2649
3367
  'last-row': isLastRow
2650
3368
  }),
2651
3369
  key: "col" + i,
2652
- "data-date": getCalendarDate(_dateShow),
2653
- "data-day": padZero(d),
3370
+ "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)(_dateShow),
3371
+ "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(d),
2654
3372
  "data-week": i,
2655
3373
  onMouseEnter: function onMouseEnter(e) {
2656
3374
  onCellMouseEnter === null || onCellMouseEnter === void 0 ? void 0 : onCellMouseEnter(e);
@@ -2662,92 +3380,84 @@ var EventCalendar = function EventCalendar(props) {
2662
3380
  //
2663
3381
  onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(e);
2664
3382
  if (d > 0) {
2665
- handleDayChange(e, d);
2666
- onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, _currentData.length === 0 ? {
2667
- id: 0,
2668
- date: getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(d))
2669
- } : _currentData[0]);
2670
- if (EVENTS_ENABLED) {
2671
- onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen(_currentData.length === 0 ? {
2672
- id: 0,
2673
- date: getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(d))
2674
- } : _currentData[0], function () {
2675
- return setShowEdit(true);
2676
- });
2677
- }
3383
+ handleDayChange(e, d); // update current day
3384
+ onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, null);
2678
3385
  }
2679
3386
  }
2680
- }, isFirstRow && __forwardFillNum && typeof __forwardFillNum[i] !== 'undefined' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
3387
+ }, 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("span", {
2681
3388
  className: "disabled"
2682
- }, __forwardFillNum[i])) : null, d > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, d) : null, isLastRow && __backFillNum && typeof __backFillNum[i - item.col.filter(Boolean).length] !== 'undefined' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
3389
+ }, __forwardFillNum[i])) : null, d > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, d) : null, isBack ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
2683
3390
  className: "disabled"
2684
- }, __backFillNum[i - item.col.filter(Boolean).length]) : null, _currentData.length > 0 ? /*#__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", {
2685
- className: "e-cal__day__event",
2686
- style: typeof _currentData[0] !== 'undefined' && _currentData[0].eventStyles !== 'undefined' ? _currentData[0].eventStyles : {},
2687
- dangerouslySetInnerHTML: {
2688
- __html: _currentData[0].data
2689
- }
2690
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2691
- className: "e-cal__day__eventdel ".concat(cellCloseBtnClassName || '')
3391
+ }, __backFillNum[i - item.col.filter(Boolean).length]) : null, _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", {
3392
+ className: "e-cal-normal__day__eventadd ".concat(cellAddBtnClassName || '')
2692
3393
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
2693
3394
  href: "#",
2694
3395
  tabIndex: -1,
2695
3396
  className: "align-middle",
3397
+ "data-date": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)(_dateShow),
3398
+ "data-day": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(d),
3399
+ "data-week": i,
2696
3400
  onClick: function onClick(e) {
2697
3401
  e.preventDefault();
2698
3402
  e.stopPropagation();
2699
- setShowDelete(true);
2700
- onModalDeleteOpen === null || onModalDeleteOpen === void 0 ? void 0 : onModalDeleteOpen(_currentData.length === 0 ? {
2701
- id: 0,
2702
- date: getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(d))
2703
- } : _currentData[0]);
3403
+
3404
+ // update cell data
3405
+ setTableCellId(-1);
3406
+
3407
+ //
3408
+ if (d > 0) {
3409
+ handleDayChange(e, d); // update current day
3410
+
3411
+ onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(e, {
3412
+ id: 0,
3413
+ date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
3414
+ });
3415
+ if (EVENTS_ENABLED) {
3416
+ onModalEditOpen === null || onModalEditOpen === void 0 ? void 0 : onModalEditOpen({
3417
+ id: 0,
3418
+ date: (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.getCalendarDate)("".concat(year, "-").concat(month + 1, "-").concat(d))
3419
+ }, function () {
3420
+ return setShowEdit(true);
3421
+ }, 'new');
3422
+ }
3423
+ }
2704
3424
  }
2705
- }, 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", {
2706
- width: "20px",
2707
- height: "20px",
2708
- viewBox: "0 0 24 24",
2709
- fill: "none"
2710
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
2711
- fillRule: "evenodd",
2712
- clipRule: "evenodd",
2713
- d: "M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10ZM8 11a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Z",
2714
- fill: "#000"
2715
- }))), cellCloseBtnLabel || ''))) : null);
3425
+ }, _addBtn()))));
2716
3426
  }));
2717
3427
  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2718
- className: "e-cal__month-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ".concat(winMonth ? 'active' : '')
3428
+ className: "e-cal-normal__month-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ".concat(winMonth ? 'active' : '')
2719
3429
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2720
- className: "e-cal__month-container"
3430
+ className: "e-cal-normal__month-container"
2721
3431
  }, MONTHS_FULL.map(function (month, index) {
2722
3432
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2723
- "data-month": padZero(index + 1),
2724
- className: "e-cal__month ".concat(selectedMonth === index ? ' selected' : ''),
3433
+ "data-month": (0,funda_utils_dist_cjs_date__WEBPACK_IMPORTED_MODULE_1__.padZero)(index + 1),
3434
+ className: "e-cal-normal__month ".concat(selectedMonth === index ? ' selected' : ''),
2725
3435
  key: month + index,
2726
3436
  onClick: function onClick() {
2727
3437
  handleMonthChange(index);
2728
3438
  }
2729
3439
  }, month);
2730
3440
  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2731
- className: "e-cal__year-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ".concat(winYear ? 'active' : '')
3441
+ className: "e-cal-normal__year-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ".concat(winYear ? 'active' : '')
2732
3442
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2733
- className: "e-cal__year-container bg-body-tertiary"
3443
+ className: "e-cal-normal__year-container bg-body-tertiary"
2734
3444
  }, yearsArray.map(function (year, index) {
2735
3445
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2736
3446
  "data-year": year,
2737
- className: "e-cal__year ".concat(selectedYear === year ? ' selected' : ''),
3447
+ className: "e-cal-normal__year ".concat(selectedYear === year ? ' selected' : ''),
2738
3448
  key: year + index,
2739
3449
  onClick: function onClick() {
2740
3450
  handleYearChange(year);
2741
3451
  }
2742
3452
  }, year);
2743
3453
  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2744
- className: "e-cal__today-wrapper p-2 bg-body-tertiary"
3454
+ className: "e-cal-normal__today-wrapper p-2 bg-body-tertiary"
2745
3455
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
2746
3456
  tabIndex: -1,
2747
3457
  type: "button",
2748
- className: "e-cal__btn e-cal__btn--today",
3458
+ className: "e-cal-normal__btn e-cal-normal__btn--today",
2749
3459
  onClick: handleTodayChange
2750
- }, langToday || 'Today'))), 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()), {
3460
+ }, langToday || 'Today'))), 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_3___default()), {
2751
3461
  show: showDelete,
2752
3462
  maskOpacity: modalMaskOpacity,
2753
3463
  triggerClassName: "",
@@ -2759,29 +3469,16 @@ var EventCalendar = function EventCalendar(props) {
2759
3469
  onClose: function onClose(e) {
2760
3470
  setTimeout(function () {
2761
3471
  setShowDelete(false);
2762
- var _currentData = val.filter(function (item) {
2763
- return getCalendarDate(item.date) === getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day));
2764
- });
2765
- onModalDeleteClose === null || onModalDeleteClose === void 0 ? void 0 : onModalDeleteClose(_currentData.length === 0 ? {
2766
- id: 0,
2767
- date: getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day))
2768
- } : _currentData[0]);
3472
+ onModalDeleteClose === null || onModalDeleteClose === void 0 ? void 0 : onModalDeleteClose(queryItemObj());
2769
3473
  }, 350);
2770
3474
  },
2771
3475
  onSubmit: /*#__PURE__*/function () {
2772
3476
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, closewin, data) {
2773
- var _currentData;
2774
3477
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2775
3478
  while (1) switch (_context.prev = _context.next) {
2776
3479
  case 0:
2777
- _currentData = val.filter(function (item) {
2778
- return getCalendarDate(item.date) === getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day));
2779
- });
2780
- onModalDeleteEvent === null || onModalDeleteEvent === void 0 ? void 0 : onModalDeleteEvent(_currentData.length === 0 ? {
2781
- id: 0,
2782
- date: getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day))
2783
- } : _currentData[0], closewin);
2784
- case 2:
3480
+ onModalDeleteEvent === null || onModalDeleteEvent === void 0 ? void 0 : onModalDeleteEvent(queryItemObj(), closewin);
3481
+ case 1:
2785
3482
  case "end":
2786
3483
  return _context.stop();
2787
3484
  }
@@ -2791,7 +3488,7 @@ var EventCalendar = function EventCalendar(props) {
2791
3488
  return _ref.apply(this, arguments);
2792
3489
  };
2793
3490
  }()
2794
- }, modalDeleteContent || 'Are you sure?'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_modaldialog__WEBPACK_IMPORTED_MODULE_2___default()), {
3491
+ }, modalDeleteContent || 'Are you sure?'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((funda_modaldialog__WEBPACK_IMPORTED_MODULE_3___default()), {
2795
3492
  show: showEdit,
2796
3493
  maskOpacity: modalMaskOpacity,
2797
3494
  heading: modalHeading,
@@ -2806,29 +3503,16 @@ var EventCalendar = function EventCalendar(props) {
2806
3503
  onClose: function onClose(e) {
2807
3504
  setTimeout(function () {
2808
3505
  setShowEdit(false);
2809
- var _currentData = val.filter(function (item) {
2810
- return getCalendarDate(item.date) === getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day));
2811
- });
2812
- onModalEditClose === null || onModalEditClose === void 0 ? void 0 : onModalEditClose(_currentData.length === 0 ? {
2813
- id: 0,
2814
- date: getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day))
2815
- } : _currentData[0]);
3506
+ onModalEditClose === null || onModalEditClose === void 0 ? void 0 : onModalEditClose(queryItemObj());
2816
3507
  }, 350);
2817
3508
  },
2818
3509
  onSubmit: /*#__PURE__*/function () {
2819
3510
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, closewin, data) {
2820
- var _currentData;
2821
3511
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2822
3512
  while (1) switch (_context2.prev = _context2.next) {
2823
3513
  case 0:
2824
- _currentData = val.filter(function (item) {
2825
- return getCalendarDate(item.date) === getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day));
2826
- });
2827
- onModalEditEvent === null || onModalEditEvent === void 0 ? void 0 : onModalEditEvent(_currentData.length === 0 ? {
2828
- id: 0,
2829
- date: getCalendarDate("".concat(year, "-").concat(month + 1, "-").concat(day))
2830
- } : _currentData[0], closewin);
2831
- case 2:
3514
+ onModalEditEvent === null || onModalEditEvent === void 0 ? void 0 : onModalEditEvent(queryItemObj(), closewin);
3515
+ case 1:
2832
3516
  case "end":
2833
3517
  return _context2.stop();
2834
3518
  }