funda-ui 3.7.225 → 3.8.325

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 (44) hide show
  1. package/CascadingSelect/index.js +2 -1
  2. package/CascadingSelectE2E/index.js +2 -1
  3. package/Date/index.css +19 -0
  4. package/Date/index.d.ts +2 -0
  5. package/Date/index.js +305 -16
  6. package/EventCalendar/index.css +13 -0
  7. package/EventCalendar/index.js +17 -4
  8. package/EventCalendarTimeline/index.css +13 -0
  9. package/EventCalendarTimeline/index.js +20 -4
  10. package/Input/index.js +1 -1
  11. package/LiveSearch/index.js +2 -1
  12. package/ModalDialog/index.d.ts +2 -0
  13. package/ModalDialog/index.js +8 -3
  14. package/MultiFuncSelect/index.js +2 -1
  15. package/RangeSlider/index.js +1 -1
  16. package/lib/cjs/CascadingSelect/index.js +2 -1
  17. package/lib/cjs/CascadingSelectE2E/index.js +2 -1
  18. package/lib/cjs/Date/index.d.ts +2 -0
  19. package/lib/cjs/Date/index.js +305 -16
  20. package/lib/cjs/EventCalendar/index.js +17 -4
  21. package/lib/cjs/EventCalendarTimeline/index.js +20 -4
  22. package/lib/cjs/Input/index.js +1 -1
  23. package/lib/cjs/LiveSearch/index.js +2 -1
  24. package/lib/cjs/ModalDialog/index.d.ts +2 -0
  25. package/lib/cjs/ModalDialog/index.js +8 -3
  26. package/lib/cjs/MultiFuncSelect/index.js +2 -1
  27. package/lib/cjs/RangeSlider/index.js +1 -1
  28. package/lib/css/Date/index.css +19 -0
  29. package/lib/css/EventCalendar/index.css +13 -0
  30. package/lib/css/EventCalendarTimeline/index.css +13 -0
  31. package/lib/esm/CascadingSelect/index.tsx +2 -1
  32. package/lib/esm/CascadingSelectE2E/index.tsx +2 -1
  33. package/lib/esm/Date/Calendar.tsx +176 -9
  34. package/lib/esm/Date/index.scss +30 -0
  35. package/lib/esm/Date/index.tsx +224 -8
  36. package/lib/esm/EventCalendar/index.scss +21 -0
  37. package/lib/esm/EventCalendar/index.tsx +21 -6
  38. package/lib/esm/EventCalendarTimeline/index.scss +21 -0
  39. package/lib/esm/EventCalendarTimeline/index.tsx +24 -6
  40. package/lib/esm/Input/index.tsx +1 -1
  41. package/lib/esm/LiveSearch/index.tsx +2 -1
  42. package/lib/esm/ModalDialog/index.tsx +18 -4
  43. package/lib/esm/MultiFuncSelect/index.tsx +2 -1
  44. package/package.json +1 -1
@@ -774,6 +774,7 @@ var CascadingSelect = function CascadingSelect(props) {
774
774
  onBlur = props.onBlur,
775
775
  onFocus = props.onFocus,
776
776
  attributes = _objectWithoutProperties(props, _excluded);
777
+ var DEPTH = depth || 1055; // the default value same as bootstrap
777
778
  var POS_OFFSET = 0;
778
779
  var EXCEEDED_SIDE_POS_OFFSET = Number(exceededSidePosOffset) || 15;
779
780
  var VALUE_BY_BRACES = typeof extractValueByBraces === 'undefined' ? true : extractValueByBraces;
@@ -1593,7 +1594,7 @@ var CascadingSelect = function CascadingSelect(props) {
1593
1594
  id: "cas-select__items-wrapper-".concat(idRes),
1594
1595
  className: "cas-select__items-wrapper position-absolute border shadow small",
1595
1596
  style: {
1596
- zIndex: depth ? depth : 1055,
1597
+ zIndex: DEPTH,
1597
1598
  display: 'none'
1598
1599
  }
1599
1600
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
@@ -926,6 +926,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
926
926
  onBlur = props.onBlur,
927
927
  onFocus = props.onFocus,
928
928
  attributes = _objectWithoutProperties(props, _excluded);
929
+ var DEPTH = depth || 1055; // the default value same as bootstrap
929
930
  var POS_OFFSET = 0;
930
931
  var EXCEEDED_SIDE_POS_OFFSET = Number(exceededSidePosOffset) || 15;
931
932
  var VALUE_BY_BRACES = typeof extractValueByBraces === 'undefined' ? true : extractValueByBraces;
@@ -1969,7 +1970,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
1969
1970
  id: "cas-select-e2e__items-wrapper-".concat(idRes),
1970
1971
  className: "cas-select-e2e__items-wrapper position-absolute border shadow small",
1971
1972
  style: {
1972
- zIndex: depth ? depth : 1055,
1973
+ zIndex: DEPTH,
1973
1974
  display: 'none'
1974
1975
  }
1975
1976
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
package/Date/index.css CHANGED
@@ -150,6 +150,12 @@
150
150
  color: var(--date2d-timeselected-text-color);
151
151
  background-color: var(--date2d-timeselected-bg);
152
152
  }
153
+ .date2d__wrapper .date2d__tools-container .date2d__hourslist ul li a.disabled,
154
+ .date2d__wrapper .date2d__tools-container .date2d__minuteslist ul li a.disabled,
155
+ .date2d__wrapper .date2d__tools-container .date2d__secondslist ul li a.disabled {
156
+ opacity: 0.4;
157
+ pointer-events: none;
158
+ }
153
159
  .date2d__wrapper .date2d__tools-container .date2d__hourslist ul li:hover,
154
160
  .date2d__wrapper .date2d__tools-container .date2d__minuteslist ul li:hover,
155
161
  .date2d__wrapper .date2d__tools-container .date2d__secondslist ul li:hover {
@@ -250,6 +256,10 @@
250
256
  border-top-width: 1px;
251
257
  border-right-width: 1px;
252
258
  }
259
+ .date2d-cal__wrapper .date2d-cal__row .date2d-cal__cell.disabled {
260
+ opacity: 0.4;
261
+ pointer-events: none;
262
+ }
253
263
  .date2d-cal__wrapper .date2d-cal__row .date2d-cal__cell.last-cell {
254
264
  border-right-width: 0;
255
265
  }
@@ -368,6 +378,11 @@
368
378
  background-color: var(--date2d-cal-year-month-btn-selected-bg);
369
379
  color: var(--date2d-cal-year-month-btn-selected-color);
370
380
  }
381
+ .date2d-cal__wrapper .date2d-cal__year.disabled,
382
+ .date2d-cal__wrapper .date2d-cal__month.disabled {
383
+ opacity: 0.4;
384
+ pointer-events: none;
385
+ }
371
386
  .date2d-cal__wrapper .date2d-cal__btn {
372
387
  border: none;
373
388
  outline: none;
@@ -380,6 +395,10 @@
380
395
  .date2d-cal__wrapper .date2d-cal__btn svg path {
381
396
  fill: var(--date2d-cal-header-arrow-bg);
382
397
  }
398
+ .date2d-cal__wrapper .date2d-cal__btn.disabled {
399
+ opacity: 0.4;
400
+ pointer-events: none;
401
+ }
383
402
  .date2d-cal__wrapper .date2d-cal__btn--prev, .date2d-cal__wrapper .date2d-cal__btn--next {
384
403
  border-radius: var(--date2d-cal-header-prevnext-btn-radius);
385
404
  color: var(--date2d-cal-header-prevnext-btn-color);
package/Date/index.d.ts CHANGED
@@ -16,6 +16,8 @@ declare type DateProps = {
16
16
  truncateSeconds?: boolean;
17
17
  valueUseSlash?: boolean;
18
18
  value?: string;
19
+ min?: string;
20
+ max?: string;
19
21
  placeholder?: string;
20
22
  label?: React.ReactNode | string;
21
23
  units?: string;
package/Date/index.js CHANGED
@@ -617,7 +617,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
617
617
  }, propExist(iconLeft) ? /*#__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", {
618
618
  className: controlGroupTextClassName || "input-group-text"
619
619
  }, iconLeft)) : null, appendControl && propExist(iconLeft) ? /*#__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", {
620
- className: "input-group-control-container position-relative"
620
+ className: "input-group-control-container w-100 position-relative"
621
621
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
622
622
  ref: function ref(node) {
623
623
  valRef.current = node;
@@ -1046,7 +1046,9 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
1046
1046
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1047
1047
 
1048
1048
  var Calendar = function Calendar(props) {
1049
- var customTodayDate = props.customTodayDate,
1049
+ var min = props.min,
1050
+ max = props.max,
1051
+ customTodayDate = props.customTodayDate,
1050
1052
  langWeek = props.langWeek,
1051
1053
  langWeekFull = props.langWeekFull,
1052
1054
  langMonths = props.langMonths,
@@ -1116,7 +1118,12 @@ var Calendar = function Calendar(props) {
1116
1118
  winMonth = _useState22[0],
1117
1119
  setWinMonth = _useState22[1];
1118
1120
  var padZero = function padZero(num) {
1119
- return num < 10 ? '0' + num : num.toString();
1121
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1122
+ if (padZeroEnabled) {
1123
+ return num < 10 ? '0' + num : num.toString();
1124
+ } else {
1125
+ return num.toString();
1126
+ }
1120
1127
  };
1121
1128
  var isValidDate = function isValidDate(v) {
1122
1129
  return !(String(new window.Date(v)).toLowerCase() === 'invalid date');
@@ -1128,6 +1135,48 @@ var Calendar = function Calendar(props) {
1128
1135
  var getTodayDate = function getTodayDate() {
1129
1136
  return getCalendarDate(new Date());
1130
1137
  };
1138
+ var getFullTimeData = function getFullTimeData(v) {
1139
+ var padZeroEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1140
+ if (typeof v === 'string' && !isValidDate(v)) {
1141
+ return {
1142
+ res: '0000-00-00 00:00:00',
1143
+ resNoSeconds: '0000-00-00 00:00',
1144
+ date: "0000-00-00",
1145
+ year: "0000",
1146
+ month: "00",
1147
+ day: "00",
1148
+ hours: "00",
1149
+ minutes: "00",
1150
+ seconds: "00"
1151
+ };
1152
+ }
1153
+ var date = dateFormat(v);
1154
+ var year = date.getFullYear();
1155
+ var month = padZero(date.getMonth() + 1, padZeroEnabled);
1156
+ var day = padZero(date.getDate(), padZeroEnabled);
1157
+ var hours = padZero(date.getHours(), padZeroEnabled);
1158
+ var minutes = padZero(date.getMinutes(), padZeroEnabled);
1159
+ var seconds = padZero(date.getSeconds(), padZeroEnabled);
1160
+ var res = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes, ":").concat(seconds);
1161
+ var res2 = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes);
1162
+ return {
1163
+ res: res,
1164
+ resNoSeconds: res2,
1165
+ date: "".concat(year, "-").concat(month, "-").concat(day),
1166
+ year: "".concat(year),
1167
+ month: "".concat(month),
1168
+ day: "".concat(day),
1169
+ hours: "".concat(hours),
1170
+ minutes: "".concat(minutes),
1171
+ seconds: "".concat(seconds)
1172
+ };
1173
+ };
1174
+
1175
+ //
1176
+ var MIN = typeof min !== 'undefined' && min !== '' && min !== null && isValidDate(min) ? getFullTimeData(min) : '';
1177
+ var MAX = typeof max !== 'undefined' && max !== '' && max !== null && isValidDate(max) ? getFullTimeData(max) : '';
1178
+ var currentMinDateDisabled = MIN !== '' ? Number(new window.Date().getTime()) < Number(new window.Date(MIN.res).getTime()) ? true : false : false;
1179
+ var currentMaxDateDisabled = MAX !== '' ? Number(new window.Date().getTime()) > Number(new window.Date(MAX.res).getTime()) ? true : false : false;
1131
1180
 
1132
1181
  // cell
1133
1182
  var getCells = function getCells() {
@@ -1335,6 +1384,78 @@ var Calendar = function Calendar(props) {
1335
1384
  return !prevState;
1336
1385
  });
1337
1386
  }
1387
+ function checkDisabledDay(curYear, curMonth, curDay) {
1388
+ var res = false;
1389
+
1390
+ // maximum
1391
+ if (MAX !== '') {
1392
+ if (Number(curYear) > Number(MAX.year)) {
1393
+ res = true;
1394
+ }
1395
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) > Number(MAX.month)) {
1396
+ res = true;
1397
+ }
1398
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) > Number(MAX.day)) {
1399
+ res = true;
1400
+ }
1401
+ }
1402
+
1403
+ // minimum
1404
+ if (MIN !== '') {
1405
+ if (Number(curYear) < Number(MIN.year)) {
1406
+ res = true;
1407
+ }
1408
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) < Number(MIN.month)) {
1409
+ res = true;
1410
+ }
1411
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) < Number(MIN.day)) {
1412
+ res = true;
1413
+ }
1414
+ }
1415
+ return res;
1416
+ }
1417
+ function checkDisabledMonth(curYear, curMonth) {
1418
+ var res = false;
1419
+
1420
+ // maximum
1421
+ if (MAX !== '') {
1422
+ if (Number(curYear) > Number(MAX.year)) {
1423
+ res = true;
1424
+ }
1425
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) > Number(MAX.month)) {
1426
+ res = true;
1427
+ }
1428
+ }
1429
+
1430
+ // minimum
1431
+ if (MIN !== '') {
1432
+ if (Number(curYear) < Number(MIN.year)) {
1433
+ res = true;
1434
+ }
1435
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) < Number(MIN.month)) {
1436
+ res = true;
1437
+ }
1438
+ }
1439
+ return res;
1440
+ }
1441
+ function checkDisabledYear(curYear) {
1442
+ var res = false;
1443
+
1444
+ // maximum
1445
+ if (MAX !== '') {
1446
+ if (Number(curYear) > Number(MAX.year)) {
1447
+ res = true;
1448
+ }
1449
+ }
1450
+
1451
+ // minimum
1452
+ if (MIN !== '') {
1453
+ if (Number(curYear) < Number(MIN.year)) {
1454
+ res = true;
1455
+ }
1456
+ }
1457
+ return res;
1458
+ }
1338
1459
 
1339
1460
  //if user change the selectedYear, then udate the years array that is displayed on year tab view
1340
1461
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
@@ -1352,6 +1473,13 @@ var Calendar = function Calendar(props) {
1352
1473
  if (typeof customTodayDate === 'string' && customTodayDate !== '' && isValidDate(customTodayDate)) {
1353
1474
  var _customNow = new Date(customTodayDate);
1354
1475
  setTodayDate(_customNow);
1476
+ } else {
1477
+ if (currentMaxDateDisabled) {
1478
+ setTodayDate(new Date(MAX.res));
1479
+ }
1480
+ if (currentMinDateDisabled) {
1481
+ setTodayDate(new Date(MIN.res));
1482
+ }
1355
1483
  }
1356
1484
  }, [customTodayDate]);
1357
1485
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
@@ -1459,9 +1587,10 @@ var Calendar = function Calendar(props) {
1459
1587
  }
1460
1588
  }
1461
1589
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
1462
- className: "date2d-cal__cell date2d-cal__day ".concat(d > 0 ? '' : 'empty', " ").concat(d === now.getDate() ? 'today' : '', " ").concat(d === day ? 'selected' : '', " ").concat(isLastCol ? 'last-cell' : '', " ").concat(isLastRow ? 'last-row' : ''),
1590
+ className: "date2d-cal__cell date2d-cal__day ".concat(d > 0 ? '' : 'empty', " ").concat(d === now.getDate() ? 'today' : '', " ").concat(d === day ? 'selected' : '', " ").concat(isLastCol ? 'last-cell' : '', " ").concat(isLastRow ? 'last-row' : '', " ").concat(checkDisabledDay(year, month, d) ? 'disabled' : ''),
1463
1591
  key: "col" + i,
1464
1592
  "data-date": getCalendarDate(_dateShow),
1593
+ "data-day": padZero(d),
1465
1594
  "data-week": i,
1466
1595
  onClick: function onClick(e) {
1467
1596
  if (d > 0) {
@@ -1484,7 +1613,8 @@ var Calendar = function Calendar(props) {
1484
1613
  className: "date2d-cal__month-container"
1485
1614
  }, MONTHS_FULL.map(function (month, index) {
1486
1615
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
1487
- className: "date2d-cal__month ".concat(selectedMonth === index ? ' selected' : ''),
1616
+ "data-month": padZero(index + 1),
1617
+ className: "date2d-cal__month ".concat(selectedMonth === index ? ' selected' : '', " ").concat(checkDisabledMonth(year, index) ? 'disabled' : ''),
1488
1618
  key: month + index,
1489
1619
  onClick: function onClick() {
1490
1620
  handleMonthChange(index);
@@ -1496,7 +1626,8 @@ var Calendar = function Calendar(props) {
1496
1626
  className: "date2d-cal__year-container bg-body-tertiary"
1497
1627
  }, yearsArray.map(function (year, index) {
1498
1628
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
1499
- className: "date2d-cal__year ".concat(selectedYear === year ? ' selected' : ''),
1629
+ "data-year": year,
1630
+ className: "date2d-cal__year ".concat(selectedYear === year ? ' selected' : '', " ").concat(checkDisabledYear(year) ? 'disabled' : ''),
1500
1631
  key: year + index,
1501
1632
  onClick: function onClick() {
1502
1633
  handleYearChange(year);
@@ -1507,7 +1638,7 @@ var Calendar = function Calendar(props) {
1507
1638
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
1508
1639
  tabIndex: -1,
1509
1640
  type: "button",
1510
- className: "date2d-cal__btn date2d-cal__btn--today",
1641
+ className: "date2d-cal__btn date2d-cal__btn--today ".concat(currentMaxDateDisabled || currentMinDateDisabled ? 'disabled' : ''),
1511
1642
  onClick: handleTodayChange
1512
1643
  }, langToday || 'Today'))));
1513
1644
  };
@@ -1523,7 +1654,7 @@ var zh_CN_default = /*#__PURE__*/__webpack_require__.n(zh_CN);
1523
1654
  // EXTERNAL MODULE: ./src/utils/performance.js
1524
1655
  var performance = __webpack_require__(342);
1525
1656
  ;// CONCATENATED MODULE: ./src/index.tsx
1526
- var _excluded = ["popupRef", "triggerClassName", "popupClassName", "wrapperClassName", "controlClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "delimiter", "offset", "exceededSidePosOffset", "localization", "type", "onlyTime", "truncateSeconds", "valueUseSlash", "disabled", "required", "readOnly", "value", "placeholder", "label", "units", "name", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onLoad", "onChange", "onBlur", "onFocus", "onOpenPopup", "onClosePopup", "onChangeDate", "onChangeMonth", "onChangeYear", "onChangeToday", "onChangeHours", "onChangeMinutes", "onChangeSeconds", "langHoursTitle", "langMinutesTitle", "langSecondsTitle", "langWeek", "langWeekFull", "langMonths", "langMonthsFull", "langToday"];
1657
+ var _excluded = ["popupRef", "triggerClassName", "popupClassName", "wrapperClassName", "controlClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "delimiter", "offset", "exceededSidePosOffset", "localization", "type", "onlyTime", "truncateSeconds", "valueUseSlash", "disabled", "required", "readOnly", "value", "min", "max", "placeholder", "label", "units", "name", "alt", "id", "iconLeft", "iconRight", "autoComplete", "style", "tabIndex", "onLoad", "onChange", "onBlur", "onFocus", "onOpenPopup", "onClosePopup", "onChangeDate", "onChangeMonth", "onChangeYear", "onChangeToday", "onChangeHours", "onChangeMinutes", "onChangeSeconds", "langHoursTitle", "langMinutesTitle", "langSecondsTitle", "langWeek", "langWeekFull", "langMonths", "langMonthsFull", "langToday"];
1527
1658
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1528
1659
  function src_slicedToArray(arr, i) { return src_arrayWithHoles(arr) || src_iterableToArrayLimit(arr, i) || src_unsupportedIterableToArray(arr, i) || src_nonIterableRest(); }
1529
1660
  function src_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -1563,6 +1694,8 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1563
1694
  required = props.required,
1564
1695
  readOnly = props.readOnly,
1565
1696
  value = props.value,
1697
+ min = props.min,
1698
+ max = props.max,
1566
1699
  placeholder = props.placeholder,
1567
1700
  label = props.label,
1568
1701
  units = props.units,
@@ -1680,7 +1813,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1680
1813
  _useState12 = src_slicedToArray(_useState11, 2),
1681
1814
  timeVal = _useState12[0],
1682
1815
  setTimeVal = _useState12[1];
1683
- var hoursArr = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '00'];
1816
+ var hoursArr = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
1684
1817
  var msArr = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59'];
1685
1818
 
1686
1819
  // exposes the following methods
@@ -1755,6 +1888,12 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1755
1888
  seconds: "".concat(seconds)
1756
1889
  };
1757
1890
  };
1891
+
1892
+ //
1893
+ var MIN = typeof min !== 'undefined' && min !== '' && min !== null && isValidDate(min) ? getFullTimeData(min) : '';
1894
+ var MAX = typeof max !== 'undefined' && max !== '' && max !== null && isValidDate(max) ? getFullTimeData(max) : '';
1895
+ var currentMinDateDisabled = MIN !== '' ? Number(new window.Date().getTime()) < Number(new window.Date(MIN.res).getTime()) ? true : false : false;
1896
+ var currentMaxDateDisabled = MAX !== '' ? Number(new window.Date().getTime()) > Number(new window.Date(MAX.res).getTime()) ? true : false : false;
1758
1897
  function handleScrollEvent() {
1759
1898
  popwinPosHide();
1760
1899
  }
@@ -1791,6 +1930,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1791
1930
  if (targetPos === 'top') {
1792
1931
  _modalRef.style.left = x + 'px';
1793
1932
  //_modalRef.style.top = y - POS_OFFSET - (listContentRef.current.clientHeight) - 2 + 'px';
1933
+ _modalRef.style.marginTop = 0;
1794
1934
  _modalRef.style.top = 'auto';
1795
1935
  _modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
1796
1936
  _modalRef.style.setProperty('position', 'fixed', 'important');
@@ -1798,6 +1938,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1798
1938
  _modalRef.classList.add('pos-top');
1799
1939
  }
1800
1940
  if (targetPos === 'bottom') {
1941
+ _modalRef.style.marginTop = 0;
1801
1942
  _modalRef.style.left = x + 'px';
1802
1943
  _modalRef.style.bottom = 'auto';
1803
1944
  _modalRef.style.top = y + height + POS_OFFSET + 'px';
@@ -1808,6 +1949,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1808
1949
  // STEP 3:
1809
1950
  //-----------
1810
1951
  // Determine whether it exceeds the far right or left side of the screen
1952
+ // Determine whether it exceeds the max height of the popup
1811
1953
  var _modalContent = _modalRef;
1812
1954
  var _modalBox = _modalContent.getBoundingClientRect();
1813
1955
  if (typeof _modalContent.dataset.offset === 'undefined') {
@@ -1824,9 +1966,12 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1824
1966
  _modalContent.style.marginLeft = "".concat(_modalOffsetPosition2, "px");
1825
1967
  // console.log('_modalPosition: ', _modalOffsetPosition)
1826
1968
  }
1969
+
1970
+ if (window.innerHeight - _modalBox.bottom < 0) {
1971
+ _modalRef.style.marginTop = "".concat(window.innerHeight - _modalBox.bottom, "px");
1972
+ }
1827
1973
  }
1828
1974
  }
1829
-
1830
1975
  function popwinPosHide() {
1831
1976
  setIsShow(false);
1832
1977
  onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup([partedInputYear.current, partedInputMonth.current, partedInputDay.current, partedInputHours.current, partedInputMinutes.current, partedInputSeconds.current]);
@@ -1892,6 +2037,132 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1892
2037
  var _time = type === 'datetime-local' || type === 'time' ? " ".concat(getFullTimeData(v).hours, ":").concat(getFullTimeData(v).minutes).concat(truncateSeconds ? "" : ":".concat(getFullTimeData(v).seconds)) : '';
1893
2038
  return onlyTime ? _onlyTime : "".concat(_date).concat(_time);
1894
2039
  }
2040
+ function checkDisabledSeconds(curYear, curMonth, curDay, curHours, curMinutes, curSeconds) {
2041
+ var res = false;
2042
+
2043
+ // maximum
2044
+ if (MAX !== '') {
2045
+ if (Number(curYear) > Number(MAX.year)) {
2046
+ res = true;
2047
+ }
2048
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) > Number(MAX.month)) {
2049
+ res = true;
2050
+ }
2051
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) > Number(MAX.day)) {
2052
+ res = true;
2053
+ }
2054
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) === Number(MAX.day) && Number(curHours) > Number(MAX.hours)) {
2055
+ res = true;
2056
+ }
2057
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) === Number(MAX.day) && Number(curHours) === Number(MAX.hours) && Number(curMinutes) > Number(MAX.minutes)) {
2058
+ res = true;
2059
+ }
2060
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) === Number(MAX.day) && Number(curHours) === Number(MAX.hours) && Number(curMinutes) === Number(MAX.minutes) && Number(curSeconds) > Number(MAX.seconds)) {
2061
+ res = true;
2062
+ }
2063
+ }
2064
+
2065
+ // minimum
2066
+ if (MIN !== '') {
2067
+ if (Number(curYear) < Number(MIN.year)) {
2068
+ res = true;
2069
+ }
2070
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) < Number(MIN.month)) {
2071
+ res = true;
2072
+ }
2073
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) < Number(MIN.day)) {
2074
+ res = true;
2075
+ }
2076
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) === Number(MIN.day) && Number(curHours) < Number(MIN.hours)) {
2077
+ res = true;
2078
+ }
2079
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) === Number(MIN.day) && Number(curHours) === Number(MIN.hours) && Number(curMinutes) < Number(MIN.minutes)) {
2080
+ res = true;
2081
+ }
2082
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) === Number(MIN.day) && Number(curHours) === Number(MIN.hours) && Number(curMinutes) === Number(MIN.minutes) && Number(curSeconds) < Number(MIN.seconds)) {
2083
+ res = true;
2084
+ }
2085
+ }
2086
+ return res;
2087
+ }
2088
+ function checkDisabledMinutes(curYear, curMonth, curDay, curHours, curMinutes) {
2089
+ var res = false;
2090
+
2091
+ // maximum
2092
+ if (MAX !== '') {
2093
+ if (Number(curYear) > Number(MAX.year)) {
2094
+ res = true;
2095
+ }
2096
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) > Number(MAX.month)) {
2097
+ res = true;
2098
+ }
2099
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) > Number(MAX.day)) {
2100
+ res = true;
2101
+ }
2102
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) === Number(MAX.day) && Number(curHours) > Number(MAX.hours)) {
2103
+ res = true;
2104
+ }
2105
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) === Number(MAX.day) && Number(curHours) === Number(MAX.hours) && Number(curMinutes) > Number(MAX.minutes)) {
2106
+ res = true;
2107
+ }
2108
+ }
2109
+
2110
+ // minimum
2111
+ if (MIN !== '') {
2112
+ if (Number(curYear) < Number(MIN.year)) {
2113
+ res = true;
2114
+ }
2115
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) < Number(MIN.month)) {
2116
+ res = true;
2117
+ }
2118
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) < Number(MIN.day)) {
2119
+ res = true;
2120
+ }
2121
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) === Number(MIN.day) && Number(curHours) < Number(MIN.hours)) {
2122
+ res = true;
2123
+ }
2124
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) === Number(MIN.day) && Number(curHours) === Number(MIN.hours) && Number(curMinutes) < Number(MIN.minutes)) {
2125
+ res = true;
2126
+ }
2127
+ }
2128
+ return res;
2129
+ }
2130
+ function checkDisabledHours(curYear, curMonth, curDay, curHours) {
2131
+ var res = false;
2132
+
2133
+ // maximum
2134
+ if (MAX !== '') {
2135
+ if (Number(curYear) > Number(MAX.year)) {
2136
+ res = true;
2137
+ }
2138
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) > Number(MAX.month)) {
2139
+ res = true;
2140
+ }
2141
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) > Number(MAX.day)) {
2142
+ res = true;
2143
+ }
2144
+ if (Number(curYear) === Number(MAX.year) && Number(curMonth + 1) === Number(MAX.month) && Number(curDay) === Number(MAX.day) && Number(curHours) > Number(MAX.hours)) {
2145
+ res = true;
2146
+ }
2147
+ }
2148
+
2149
+ // minimum
2150
+ if (MIN !== '') {
2151
+ if (Number(curYear) < Number(MIN.year)) {
2152
+ res = true;
2153
+ }
2154
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) < Number(MIN.month)) {
2155
+ res = true;
2156
+ }
2157
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) < Number(MIN.day)) {
2158
+ res = true;
2159
+ }
2160
+ if (Number(curYear) === Number(MIN.year) && Number(curMonth + 1) === Number(MIN.month) && Number(curDay) === Number(MIN.day) && Number(curHours) < Number(MIN.hours)) {
2161
+ res = true;
2162
+ }
2163
+ }
2164
+ return res;
2165
+ }
1895
2166
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
1896
2167
  // update default value
1897
2168
  //--------------
@@ -1907,9 +2178,22 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
1907
2178
  hours = _getFullTimeData.hours,
1908
2179
  minutes = _getFullTimeData.minutes,
1909
2180
  seconds = _getFullTimeData.seconds;
1910
- setDateVal(date);
1911
- setTimeVal([hours, minutes, seconds]);
1912
- setSplitVals([year, month, day, hours, minutes, seconds]);
2181
+ if (!currentMaxDateDisabled && !currentMinDateDisabled) {
2182
+ setDateVal(date);
2183
+ setTimeVal([hours, minutes, seconds]);
2184
+ setSplitVals([year, month, day, hours, minutes, seconds]);
2185
+ } else {
2186
+ if (currentMaxDateDisabled) {
2187
+ setDateVal(MAX.date);
2188
+ setTimeVal([MAX.hours, MAX.minutes, MAX.seconds]);
2189
+ setSplitVals([MAX.year, MAX.month, MAX.day, MAX.hours, MAX.minutes, MAX.seconds]);
2190
+ }
2191
+ if (currentMinDateDisabled) {
2192
+ setDateVal(MIN.date);
2193
+ setTimeVal([MIN.hours, MIN.minutes, MIN.seconds]);
2194
+ setSplitVals([MIN.year, MIN.month, MIN.day, MIN.hours, MIN.minutes, MIN.seconds]);
2195
+ }
2196
+ }
1913
2197
  } else {
1914
2198
  setDateDefaultValueExist(true);
1915
2199
 
@@ -2209,6 +2493,8 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2209
2493
  }, typeof onlyTime === 'undefined' || onlyTime === false ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2210
2494
  className: "date2d__calendar"
2211
2495
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(src_Calendar, {
2496
+ min: min,
2497
+ max: max,
2212
2498
  customTodayDate: changedVal,
2213
2499
  langWeek: _langWeek,
2214
2500
  langWeekFull: _langWeekFull,
@@ -2281,6 +2567,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2281
2567
  }))) : null, type === 'datetime-local' || type === 'time' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2282
2568
  className: "date2d__hourslist border-end"
2283
2569
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h3", null, _langHoursTitle), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", null, hoursArr.map(function (hour, i) {
2570
+ var _curVal = getFullTimeData("".concat(dateVal, " ").concat(timeVal[0], ":").concat(timeVal[1], ":").concat(timeVal[2]));
2284
2571
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
2285
2572
  key: i
2286
2573
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
@@ -2306,11 +2593,12 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2306
2593
  //
2307
2594
  onChangeHours === null || onChangeHours === void 0 ? void 0 : onChangeHours(_v);
2308
2595
  },
2309
- className: "".concat(timeVal[0] == hour ? 'selected' : '')
2596
+ className: "".concat(timeVal[0] == hour ? 'selected' : '', " ").concat(checkDisabledHours(_curVal.year, Number(_curVal.month) - 1, _curVal.day, hour) ? 'disabled' : '')
2310
2597
  }, hour));
2311
2598
  }))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2312
2599
  className: "date2d__minuteslist border-end"
2313
2600
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h3", null, _langMinutesTitle), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", null, msArr.map(function (v, i) {
2601
+ var _curVal = getFullTimeData("".concat(dateVal, " ").concat(timeVal[0], ":").concat(timeVal[1], ":").concat(timeVal[2]));
2314
2602
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
2315
2603
  key: i
2316
2604
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
@@ -2336,11 +2624,12 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2336
2624
  //
2337
2625
  onChangeMinutes === null || onChangeMinutes === void 0 ? void 0 : onChangeMinutes(_v);
2338
2626
  },
2339
- className: "".concat(timeVal[1] == v ? 'selected' : '')
2627
+ className: "".concat(timeVal[1] == v ? 'selected' : '', " ").concat(checkDisabledMinutes(_curVal.year, Number(_curVal.month) - 1, _curVal.day, _curVal.hours, v) ? 'disabled' : '')
2340
2628
  }, v));
2341
2629
  }))), typeof truncateSeconds === 'undefined' || truncateSeconds === false ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2342
2630
  className: "date2d__secondslist border-end"
2343
2631
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h3", null, _langSecondsTitle), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", null, msArr.map(function (v, i) {
2632
+ var _curVal = getFullTimeData("".concat(dateVal, " ").concat(timeVal[0], ":").concat(timeVal[1], ":").concat(timeVal[2]));
2344
2633
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
2345
2634
  key: i
2346
2635
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
@@ -2366,7 +2655,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2366
2655
  //
2367
2656
  onChangeSeconds === null || onChangeSeconds === void 0 ? void 0 : onChangeSeconds(_v);
2368
2657
  },
2369
- className: "".concat(timeVal[2] == v ? 'selected' : '')
2658
+ className: "".concat(timeVal[2] == v ? 'selected' : '', " ").concat(checkDisabledSeconds(_curVal.year, Number(_curVal.month) - 1, _curVal.day, _curVal.hours, _curVal.minutes, v) ? 'disabled' : '')
2370
2659
  }, v));
2371
2660
  })))) : null) : null))));
2372
2661
  });
@@ -82,6 +82,10 @@
82
82
  border-top-width: 1px;
83
83
  border-right-width: 1px;
84
84
  }
85
+ .e-cal__wrapper .e-cal__row .e-cal__cell.disabled {
86
+ opacity: 0.4;
87
+ pointer-events: none;
88
+ }
85
89
  .e-cal__wrapper .e-cal__row .e-cal__cell.last-cell {
86
90
  border-right-width: 0;
87
91
  }
@@ -200,6 +204,11 @@
200
204
  background-color: var(--e-cal-year-month-btn-selected-bg);
201
205
  color: var(--e-cal-year-month-btn-selected-color);
202
206
  }
207
+ .e-cal__wrapper .e-cal__year.disabled,
208
+ .e-cal__wrapper .e-cal__month.disabled {
209
+ opacity: 0.4;
210
+ pointer-events: none;
211
+ }
203
212
  .e-cal__wrapper .e-cal__btn {
204
213
  border: none;
205
214
  outline: none;
@@ -212,6 +221,10 @@
212
221
  .e-cal__wrapper .e-cal__btn svg path {
213
222
  fill: var(--e-cal-header-arrow-bg);
214
223
  }
224
+ .e-cal__wrapper .e-cal__btn.disabled {
225
+ opacity: 0.4;
226
+ pointer-events: none;
227
+ }
215
228
  .e-cal__wrapper .e-cal__btn--prev, .e-cal__wrapper .e-cal__btn--next {
216
229
  border-radius: var(--e-cal-header-prevnext-btn-radius);
217
230
  color: var(--e-cal-header-prevnext-btn-color);