funda-ui 3.9.311 → 3.9.320

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Date/index.css CHANGED
@@ -6,6 +6,7 @@
6
6
  --date2d-trigger-focus-box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
7
7
  --date2d-trigger-clear-bg: rgb(156, 156, 156);
8
8
  width: 100%;
9
+ /* tools */
9
10
  }
10
11
  .date2d__trigger.focus .date2d__control input {
11
12
  box-shadow: var(--date2d-trigger-focus-box-shadow);
@@ -19,19 +20,26 @@
19
20
  color: transparent;
20
21
  pointer-events: none;
21
22
  }
22
- .date2d__trigger .date2d__control .date2d__control__icon {
23
+ .date2d__trigger .date2d__control .date2d__control-tools {
23
24
  position: absolute;
24
25
  top: 0.3rem;
25
26
  right: 0.5rem;
26
27
  z-index: 6;
27
28
  cursor: pointer;
29
+ height: 1.5rem;
30
+ line-height: 1.5rem;
28
31
  }
29
- .date2d__trigger .date2d__control .date2d__control__icon .date2d__control__icon__close {
32
+ .date2d__trigger .date2d__control .date2d__control-tools.date2d__control-tools--hover-show-tools {
33
+ transform: scale(0);
34
+ transition: 0.1s ease-in-out;
35
+ transition-delay: 0.25s;
36
+ }
37
+ .date2d__trigger .date2d__control .date2d__control-tools .date2d__control-tools__close {
30
38
  display: inline-block;
31
39
  margin-right: 0.2rem;
32
40
  pointer-events: all;
33
41
  }
34
- .date2d__trigger .date2d__control .date2d__control__icon .date2d__control__icon__close svg path {
42
+ .date2d__trigger .date2d__control .date2d__control-tools .date2d__control-tools__close svg path {
35
43
  fill: var(--date2d-trigger-clear-bg);
36
44
  }
37
45
  .date2d__trigger .date2d__control__inputplaceholder {
@@ -68,6 +76,9 @@
68
76
  .date2d__trigger .date2d__control .input-group:not(.has-left-content) .date2d__control__inputplaceholder {
69
77
  left: 0.5rem;
70
78
  }
79
+ .date2d__trigger.date2d__trigger--hover-show-tools:hover .date2d__control-tools.date2d__control-tools--hover-show-tools {
80
+ transform: scale(1);
81
+ }
71
82
 
72
83
  .date2d__wrapper {
73
84
  --date2d-box-shadow: 0 5px 15px 0 rgba(0,0,0,.07), 0 15px 35px 0 rgba(50,50,93,.1);
package/Date/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  declare type DateProps = {
3
+ contentRef?: React.RefObject<any>;
3
4
  popupRef?: React.RefObject<any>;
4
5
  popupClassName?: string;
5
6
  triggerClassName?: string;
@@ -8,6 +9,8 @@ declare type DateProps = {
8
9
  controlGroupWrapperClassName?: string;
9
10
  controlGroupTextClassName?: string;
10
11
  delimiter?: string;
12
+ hideClearButton?: boolean;
13
+ showToolsWhenHover?: boolean;
11
14
  offset?: number;
12
15
  exceededSidePosOffset?: number;
13
16
  localization?: 'en_US' | 'zh_CN';
@@ -35,10 +38,10 @@ declare type DateProps = {
35
38
  autoComplete?: string;
36
39
  tabIndex?: number;
37
40
  [key: `data-${string}`]: string | undefined;
38
- onLoad?: (e: any, data: any) => void;
39
- onChange?: (e: any, data: any, isValidDate: boolean) => void;
40
- onBlur?: (e: any) => void;
41
- onFocus?: (e: any) => void;
41
+ onLoad?: (e: any, data: any, allSplittingInputs: any[]) => void;
42
+ onChange?: (e: any, data: any, isValidDate: boolean, allSplittingInputs: any[]) => void;
43
+ onBlur?: (e: any, allSplittingInputs: any[]) => void;
44
+ onFocus?: (e: any, allSplittingInputs: any[]) => void;
42
45
  onOpenPopup?: (allSplittingInputs: any[]) => void;
43
46
  onClosePopup?: (allSplittingInputs: any[]) => void;
44
47
  onChangeDate?: (currentData: any) => void;
package/Date/index.js CHANGED
@@ -2092,7 +2092,7 @@ var zh_CN_default = /*#__PURE__*/__webpack_require__.n(zh_CN);
2092
2092
  // EXTERNAL MODULE: ./src/utils/performance.js
2093
2093
  var performance = __webpack_require__(342);
2094
2094
  ;// CONCATENATED MODULE: ./src/index.tsx
2095
- var _excluded = ["popupRef", "triggerClassName", "popupClassName", "wrapperClassName", "controlClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "delimiter", "offset", "exceededSidePosOffset", "localization", "type", "onlyTime", "truncateSeconds", "valueUseSlash", "disabled", "required", "readOnly", "value", "clickInitValue", "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"];
2095
+ var _excluded = ["contentRef", "popupRef", "triggerClassName", "popupClassName", "wrapperClassName", "controlClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "delimiter", "hideClearButton", "showToolsWhenHover", "offset", "exceededSidePosOffset", "localization", "type", "onlyTime", "truncateSeconds", "valueUseSlash", "disabled", "required", "readOnly", "value", "clickInitValue", "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"];
2096
2096
  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); }
2097
2097
  function src_slicedToArray(arr, i) { return src_arrayWithHoles(arr) || src_iterableToArrayLimit(arr, i) || src_unsupportedIterableToArray(arr, i) || src_nonIterableRest(); }
2098
2098
  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."); }
@@ -2114,7 +2114,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
2114
2114
 
2115
2115
 
2116
2116
  var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, _ref) {
2117
- var popupRef = props.popupRef,
2117
+ var contentRef = props.contentRef,
2118
+ popupRef = props.popupRef,
2118
2119
  triggerClassName = props.triggerClassName,
2119
2120
  popupClassName = props.popupClassName,
2120
2121
  wrapperClassName = props.wrapperClassName,
@@ -2122,6 +2123,8 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2122
2123
  controlGroupWrapperClassName = props.controlGroupWrapperClassName,
2123
2124
  controlGroupTextClassName = props.controlGroupTextClassName,
2124
2125
  delimiter = props.delimiter,
2126
+ hideClearButton = props.hideClearButton,
2127
+ showToolsWhenHover = props.showToolsWhenHover,
2125
2128
  offset = props.offset,
2126
2129
  exceededSidePosOffset = props.exceededSidePosOffset,
2127
2130
  localization = props.localization,
@@ -2184,6 +2187,8 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2184
2187
  //
2185
2188
  var DELIMITER_DATE = delimiter || '/';
2186
2189
  var DELIMITER_TIME = ':';
2190
+ var SHOW_TOOLS_ENABLED = !(typeof showToolsWhenHover === 'undefined' || showToolsWhenHover === false);
2191
+ var HIDE_CLEAR_BTN_ENABLED = !(typeof hideClearButton === 'undefined' || hideClearButton === false);
2187
2192
 
2188
2193
  // placeholder
2189
2194
  var datePlaceholder = placeholder || placeholder === '' ? placeholder : 'yyyy/MM/dd HH:mm:ss';
@@ -2264,6 +2269,11 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2264
2269
  // blur for popup window
2265
2270
  var popupBlurEnabled = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false); // DO NOT USE 'useState()'
2266
2271
 
2272
+ //
2273
+ var getAllSplittingInputs = function getAllSplittingInputs() {
2274
+ return [partedInputYear.current, partedInputMonth.current, partedInputDay.current, partedInputHours.current, partedInputMinutes.current, partedInputSeconds.current];
2275
+ };
2276
+
2267
2277
  // exposes the following methods
2268
2278
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(popupRef, function () {
2269
2279
  return {
@@ -2273,6 +2283,30 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2273
2283
  }
2274
2284
  };
2275
2285
  }, [popupRef]);
2286
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(contentRef, function () {
2287
+ return {
2288
+ clear: function clear(cb) {
2289
+ clearAll();
2290
+ cb === null || cb === void 0 ? void 0 : cb();
2291
+ },
2292
+ blur: function blur(cb) {
2293
+ getAllSplittingInputs().forEach(function (el) {
2294
+ if (el !== null) el.blur();
2295
+ });
2296
+ handleBlur(null);
2297
+ cb === null || cb === void 0 ? void 0 : cb();
2298
+ },
2299
+ /*
2300
+ set('2024-04-18 21:54:09', () => { console.log('callback') }])
2301
+ */
2302
+ set: function set(value, cb) {
2303
+ var _defaultValueIsEmpty = typeof value === 'undefined' || value === null || value === 'null' || value === '';
2304
+ setDateDefaultValueExist(_defaultValueIsEmpty ? false : true);
2305
+ initValue(value);
2306
+ cb === null || cb === void 0 ? void 0 : cb();
2307
+ }
2308
+ };
2309
+ }, [contentRef]);
2276
2310
  var windowScrollUpdate = (0,performance.debounce)(handleScrollEvent, 50);
2277
2311
  var eventFire = function eventFire(el, etype) {
2278
2312
  if (el.fireEvent) {
@@ -2323,8 +2357,6 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2323
2357
  //
2324
2358
  var MIN = typeof min !== 'undefined' && min !== '' && min !== null && (0,utils_date.isValidDate)(min) ? getFullTimeData(min) : '';
2325
2359
  var MAX = typeof max !== 'undefined' && max !== '' && max !== null && (0,utils_date.isValidDate)(max) ? getFullTimeData(max) : '';
2326
- var currentMinDateDisabled = MIN !== '' ? Number(new window.Date().getTime()) < Number(new window.Date(MIN.res).getTime()) ? true : false : false;
2327
- var currentMaxDateDisabled = MAX !== '' ? Number(new window.Date().getTime()) > Number(new window.Date(MAX.res).getTime()) ? true : false : false;
2328
2360
  var getActualDefaultValue = function getActualDefaultValue(v) {
2329
2361
  var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2330
2362
  var _v = getFullTimeData((0,utils_date.getNow)());
@@ -2433,7 +2465,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2433
2465
  }
2434
2466
  function popwinPosHide() {
2435
2467
  setIsShow(false);
2436
- onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup([partedInputYear.current, partedInputMonth.current, partedInputDay.current, partedInputHours.current, partedInputMinutes.current, partedInputSeconds.current]);
2468
+ onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup(getAllSplittingInputs());
2437
2469
  }
2438
2470
  function handleClickOutside(event) {
2439
2471
  if (event.target.closest(".date2d__wrapper") === null && event.target.closest(".date2d-cal__wrapper") === null) {
@@ -2445,7 +2477,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2445
2477
 
2446
2478
  // move out the popup window
2447
2479
  if (popupBlurEnabled.current) {
2448
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current);
2480
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current, getAllSplittingInputs());
2449
2481
  popupBlurEnabled.current = false;
2450
2482
  }
2451
2483
  }
@@ -2454,7 +2486,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2454
2486
  setIsShow(true);
2455
2487
  setTimeout(function () {
2456
2488
  popwinPosInit();
2457
- onOpenPopup === null || onOpenPopup === void 0 ? void 0 : onOpenPopup([partedInputYear.current, partedInputMonth.current, partedInputDay.current, partedInputHours.current, partedInputMinutes.current, partedInputSeconds.current]);
2489
+ onOpenPopup === null || onOpenPopup === void 0 ? void 0 : onOpenPopup(getAllSplittingInputs());
2458
2490
  }, 0);
2459
2491
 
2460
2492
  // focus
@@ -2465,13 +2497,13 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2465
2497
  (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.add('focus');
2466
2498
 
2467
2499
  //
2468
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(inputRef.current);
2500
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(inputRef.current, getAllSplittingInputs());
2469
2501
  }
2470
2502
  function handleChange(event) {
2471
2503
  var val = event.target.value;
2472
2504
 
2473
2505
  //
2474
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, val, (0,utils_date.isValidDate)(val));
2506
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, val, (0,utils_date.isValidDate)(val), getAllSplittingInputs());
2475
2507
  }
2476
2508
  function handleBlur(event) {
2477
2509
  var _rootRef$current3;
@@ -2479,7 +2511,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2479
2511
  (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
2480
2512
 
2481
2513
  //
2482
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current);
2514
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(inputRef.current, getAllSplittingInputs());
2483
2515
  }
2484
2516
  function handleInitSplitClickEv(e) {
2485
2517
  e.preventDefault();
@@ -2489,17 +2521,20 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2489
2521
  resetDefauleValueExist();
2490
2522
  var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
2491
2523
  var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
2492
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
2524
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
2493
2525
  }
2494
2526
  function handleKeypress(event) {
2495
2527
  if (event.code == "Enter") {
2496
2528
  event.preventDefault();
2529
+ getAllSplittingInputs().forEach(function (el) {
2530
+ if (el !== null) el.blur();
2531
+ });
2497
2532
  handleBlur(null);
2498
2533
  }
2499
2534
  }
2500
2535
  function clearAll() {
2501
2536
  setDateDefaultValueExist(false);
2502
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, '', false);
2537
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, '', false, getAllSplittingInputs());
2503
2538
  }
2504
2539
  function resetDefauleValueExist() {
2505
2540
  if (!dateDefaultValueExist) setDateDefaultValueExist(true);
@@ -2671,7 +2706,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2671
2706
  _initValue2 = src_slicedToArray(_initValue, 2),
2672
2707
  a = _initValue2[0],
2673
2708
  b = _initValue2[1];
2674
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(a, getFullTimeData(b));
2709
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(a, getFullTimeData(b), getAllSplittingInputs());
2675
2710
 
2676
2711
  //--------------
2677
2712
  document.removeEventListener('pointerdown', handleClickOutside);
@@ -2693,21 +2728,23 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2693
2728
  // window.removeEventListener('touchmove', windowScrollUpdate);
2694
2729
  };
2695
2730
  }, [value]);
2696
- 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", {
2731
+ 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, label ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2697
2732
  className: "date2d__label"
2698
- }, label ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
2733
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
2699
2734
  htmlFor: idRes,
2700
2735
  className: "form-label",
2701
2736
  dangerouslySetInnerHTML: {
2702
2737
  __html: "".concat(label)
2703
2738
  }
2704
- }) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
2739
+ })) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2740
+ className: "date2d__label"
2741
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
2705
2742
  htmlFor: idRes,
2706
2743
  className: "form-label"
2707
- }, label)) : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2744
+ }, label))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2708
2745
  ref: rootRef,
2709
2746
  "data-overlay-id": "date2d__wrapper-".concat(idRes),
2710
- className: "date2d__trigger d-inline-block is-".concat(type, " ").concat(triggerClassName || ''),
2747
+ className: "date2d__trigger d-inline-block is-".concat(type, " ").concat(triggerClassName || '', " ").concat(SHOW_TOOLS_ENABLED ? 'date2d__trigger--hover-show-tools' : ''),
2711
2748
  onClick: handleShow,
2712
2749
  onFocus: handleFocus,
2713
2750
  onBlur: handleBlur,
@@ -2763,7 +2800,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2763
2800
  if (_val !== '' && !(0,utils_date.isValidYear)(_val) && !(0,utils_date.isNumeric)(_val)) _val = "".concat((0,utils_date.getCurrentYear)());
2764
2801
  var _date = "".concat(_val, "-").concat(splitVals[1], "-").concat(splitVals[2]);
2765
2802
  var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
2766
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
2803
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
2767
2804
  setSplitVals(function (prevState) {
2768
2805
  return [_val, prevState[1], prevState[2], prevState[3], prevState[4], prevState[5]];
2769
2806
  });
@@ -2793,7 +2830,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2793
2830
  if (_val !== '' && !(0,utils_date.isValidMonth)(_val) && !(0,utils_date.isNumeric)(_val)) _val = "".concat((0,utils_date.getCurrentMonth)());
2794
2831
  var _date = "".concat(splitVals[0], "-").concat(_val, "-").concat(splitVals[2]);
2795
2832
  var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
2796
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
2833
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
2797
2834
  setSplitVals(function (prevState) {
2798
2835
  return [prevState[0], _val, prevState[2], prevState[3], prevState[4], prevState[5]];
2799
2836
  });
@@ -2828,7 +2865,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2828
2865
  if (_val !== '' && !(0,utils_date.isValidDay)(_val) && !(0,utils_date.isNumeric)(_val)) _val = "".concat((0,utils_date.getCurrentDay)());
2829
2866
  var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(_val);
2830
2867
  var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(splitVals[5]);
2831
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
2868
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
2832
2869
  setSplitVals(function (prevState) {
2833
2870
  return [prevState[0], prevState[1], _val, prevState[3], prevState[4], prevState[5]];
2834
2871
  });
@@ -2855,7 +2892,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2855
2892
  if (_val !== '' && !(0,utils_date.isValidHours)(_val) && !(0,utils_date.isNumeric)(_val)) _val = '00';
2856
2893
  var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
2857
2894
  var _full = "".concat(_date, " ").concat(_val, ":").concat(splitVals[4], ":").concat(splitVals[5]);
2858
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
2895
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
2859
2896
  setSplitVals(function (prevState) {
2860
2897
  return [prevState[0], prevState[1], prevState[2], _val, prevState[4], prevState[5]];
2861
2898
  });
@@ -2882,7 +2919,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2882
2919
  if (_val !== '' && !(0,utils_date.isValidMinutesAndSeconds)(_val) && !(0,utils_date.isNumeric)(_val)) _val = '00';
2883
2920
  var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
2884
2921
  var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(_val, ":").concat(splitVals[5]);
2885
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
2922
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
2886
2923
  setSplitVals(function (prevState) {
2887
2924
  return [prevState[0], prevState[1], prevState[2], prevState[3], _val, prevState[5]];
2888
2925
  });
@@ -2909,7 +2946,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2909
2946
  if (_val !== '' && !(0,utils_date.isValidMinutesAndSeconds)(_val) && !(0,utils_date.isNumeric)(_val)) _val = '00';
2910
2947
  var _date = "".concat(splitVals[0], "-").concat(splitVals[1], "-").concat(splitVals[2]);
2911
2948
  var _full = "".concat(_date, " ").concat(splitVals[3], ":").concat(splitVals[4], ":").concat(_val);
2912
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full));
2949
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, valueResConverter(_full), (0,utils_date.isValidDate)(_full), getAllSplittingInputs());
2913
2950
  setSplitVals(function (prevState) {
2914
2951
  return [prevState[0], prevState[1], prevState[2], prevState[3], prevState[4], _val];
2915
2952
  });
@@ -2922,11 +2959,11 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2922
2959
  }, attributes))) : null) : null)),
2923
2960
  style: style
2924
2961
  }, attributes)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
2925
- className: "date2d__control__icon"
2962
+ className: "date2d__control-tools ".concat(SHOW_TOOLS_ENABLED ? 'date2d__control-tools--hover-show-tools' : '')
2926
2963
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
2927
2964
  tabIndex: -1,
2928
2965
  href: "#",
2929
- className: "date2d__control__icon__close ".concat(dateDefaultValueExist ? '' : 'd-none'),
2966
+ className: "date2d__control-tools__close ".concat(HIDE_CLEAR_BTN_ENABLED ? 'd-none' : '', " ").concat(dateDefaultValueExist ? '' : 'd-none'),
2930
2967
  onClick: function onClick(e) {
2931
2968
  e.preventDefault();
2932
2969
  e.stopPropagation(); // Avoid triggering pop-ups
@@ -2984,7 +3021,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
2984
3021
  setSplitVals(function (prevState) {
2985
3022
  return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
2986
3023
  });
2987
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
3024
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
2988
3025
 
2989
3026
  //
2990
3027
  _onChangeDate === null || _onChangeDate === void 0 ? void 0 : _onChangeDate(_v);
@@ -3003,7 +3040,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
3003
3040
  setSplitVals(function (prevState) {
3004
3041
  return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
3005
3042
  });
3006
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
3043
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
3007
3044
 
3008
3045
  //
3009
3046
  _onChangeToday === null || _onChangeToday === void 0 ? void 0 : _onChangeToday(_v);
@@ -3022,7 +3059,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
3022
3059
  setSplitVals(function (prevState) {
3023
3060
  return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
3024
3061
  });
3025
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
3062
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
3026
3063
 
3027
3064
  //
3028
3065
  _onChangeMonth === null || _onChangeMonth === void 0 ? void 0 : _onChangeMonth(_v);
@@ -3041,7 +3078,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
3041
3078
  setSplitVals(function (prevState) {
3042
3079
  return [_v.year, _v.month, _v.day, prevState[3], prevState[4], prevState[5]];
3043
3080
  });
3044
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
3081
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
3045
3082
 
3046
3083
  //
3047
3084
  _onChangeYear === null || _onChangeYear === void 0 ? void 0 : _onChangeYear(_v);
@@ -3073,7 +3110,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
3073
3110
  setSplitVals(function (prevState) {
3074
3111
  return [prevState[0], prevState[1], prevState[2], _v.hours, prevState[4], prevState[5]];
3075
3112
  });
3076
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
3113
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
3077
3114
 
3078
3115
  //
3079
3116
  onChangeHours === null || onChangeHours === void 0 ? void 0 : onChangeHours(_v);
@@ -3107,7 +3144,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
3107
3144
  setSplitVals(function (prevState) {
3108
3145
  return [prevState[0], prevState[1], prevState[2], prevState[3], _v.minutes, prevState[5]];
3109
3146
  });
3110
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
3147
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
3111
3148
 
3112
3149
  //
3113
3150
  onChangeMinutes === null || onChangeMinutes === void 0 ? void 0 : onChangeMinutes(_v);
@@ -3141,7 +3178,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
3141
3178
  setSplitVals(function (prevState) {
3142
3179
  return [prevState[0], prevState[1], prevState[2], prevState[3], prevState[5], _v.seconds];
3143
3180
  });
3144
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true);
3181
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(inputRef.current, _v, true, getAllSplittingInputs());
3145
3182
 
3146
3183
  //
3147
3184
  onChangeSeconds === null || onChangeSeconds === void 0 ? void 0 : onChangeSeconds(_v);
@@ -1282,7 +1282,7 @@ var MultiFuncSelect = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
1282
1282
  cb === null || cb === void 0 ? void 0 : cb();
1283
1283
  },
1284
1284
  /*
1285
- set([{"label": "Option 1","listItemLabel":"Option 1 (No: 001)","value": "value-1","queryString": "option1"}, () => { console.log('callback') }])
1285
+ set([{"label": "Option 1","listItemLabel":"Option 1 (No: 001)","value": "value-1","queryString": "option1"}], () => { console.log('callback') }])
1286
1286
  */
1287
1287
  set: function set(value, cb) {
1288
1288
  if (MULTI_SEL_VALID) {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  declare type DateProps = {
3
+ contentRef?: React.RefObject<any>;
3
4
  popupRef?: React.RefObject<any>;
4
5
  popupClassName?: string;
5
6
  triggerClassName?: string;
@@ -8,6 +9,8 @@ declare type DateProps = {
8
9
  controlGroupWrapperClassName?: string;
9
10
  controlGroupTextClassName?: string;
10
11
  delimiter?: string;
12
+ hideClearButton?: boolean;
13
+ showToolsWhenHover?: boolean;
11
14
  offset?: number;
12
15
  exceededSidePosOffset?: number;
13
16
  localization?: 'en_US' | 'zh_CN';
@@ -35,10 +38,10 @@ declare type DateProps = {
35
38
  autoComplete?: string;
36
39
  tabIndex?: number;
37
40
  [key: `data-${string}`]: string | undefined;
38
- onLoad?: (e: any, data: any) => void;
39
- onChange?: (e: any, data: any, isValidDate: boolean) => void;
40
- onBlur?: (e: any) => void;
41
- onFocus?: (e: any) => void;
41
+ onLoad?: (e: any, data: any, allSplittingInputs: any[]) => void;
42
+ onChange?: (e: any, data: any, isValidDate: boolean, allSplittingInputs: any[]) => void;
43
+ onBlur?: (e: any, allSplittingInputs: any[]) => void;
44
+ onFocus?: (e: any, allSplittingInputs: any[]) => void;
42
45
  onOpenPopup?: (allSplittingInputs: any[]) => void;
43
46
  onClosePopup?: (allSplittingInputs: any[]) => void;
44
47
  onChangeDate?: (currentData: any) => void;