funda-ui 4.7.515 → 4.7.525

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.
@@ -2540,7 +2540,7 @@ function Group(props) {
2540
2540
  "data-value": JSON.stringify(item),
2541
2541
  "data-level": level,
2542
2542
  "data-query": item.queryId,
2543
- className: (0,cls.combinedCls)('casc-select-e2e__opt', {
2543
+ className: (0,cls.combinedCls)('casc-menu-e2e__opt', {
2544
2544
  'active': item.current
2545
2545
  }),
2546
2546
  dangerouslySetInnerHTML: {
@@ -2554,13 +2554,13 @@ function Group(props) {
2554
2554
  } else {
2555
2555
  return columnTitle[level] === '' || perColumnHeadersShow === false ? null : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h3", {
2556
2556
  key: index,
2557
- className: "casc-select-e2e__opt-header"
2557
+ className: "casc-menu-e2e__opt-header"
2558
2558
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
2559
2559
  dangerouslySetInnerHTML: {
2560
2560
  __html: columnTitle[level]
2561
2561
  }
2562
2562
  }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
2563
- className: "casc-select-e2e__opt-header__clean"
2563
+ className: "casc-menu-e2e__opt-header__clean"
2564
2564
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
2565
2565
  tabIndex: -1,
2566
2566
  href: "#",
@@ -2798,7 +2798,7 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
2798
2798
  if (rootRef.current === null || inputRef.current === null) return;
2799
2799
 
2800
2800
  // update modal position
2801
- var _modalRef = document.querySelector("#casc-select-e2e__items-wrapper-".concat(idRes));
2801
+ var _modalRef = document.querySelector("#casc-menu-e2e__items-wrapper-".concat(idRes));
2802
2802
  var _triggerRef = inputRef.current;
2803
2803
 
2804
2804
  // console.log(getAbsolutePositionOfStage(_triggerRef));
@@ -2870,7 +2870,7 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
2870
2870
  }
2871
2871
 
2872
2872
  function popwinPosHide() {
2873
- var _modalRef = document.querySelector("#casc-select-e2e__items-wrapper-".concat(idRes));
2873
+ var _modalRef = document.querySelector("#casc-menu-e2e__items-wrapper-".concat(idRes));
2874
2874
  if (_modalRef !== null) {
2875
2875
  // remove classnames and styles
2876
2876
  _modalRef.classList.remove('active');
@@ -2881,9 +2881,9 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
2881
2881
  var level = arguments.length > 2 ? arguments[2] : undefined;
2882
2882
  if (listRef.current === null) return;
2883
2883
  var latestDisplayColIndex = 0;
2884
- var currentItemsInner = listRef.current.querySelector('.casc-select-e2e__items-inner');
2884
+ var currentItemsInner = listRef.current.querySelector('.casc-menu-e2e__items-inner');
2885
2885
  if (currentItemsInner !== null) {
2886
- var colItemsWrapper = [].slice.call(currentItemsInner.querySelectorAll('.casc-select-e2e__items-col'));
2886
+ var colItemsWrapper = [].slice.call(currentItemsInner.querySelectorAll('.casc-menu-e2e__items-col'));
2887
2887
  colItemsWrapper.forEach(function (perCol) {
2888
2888
  perCol.classList.remove('hide-col');
2889
2889
  });
@@ -3204,10 +3204,10 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3204
3204
 
3205
3205
  // active current option with DOM
3206
3206
  //////////////////////////////////////////
3207
- var currentItemsInner = e.currentTarget.closest('.casc-select-e2e__items-inner');
3207
+ var currentItemsInner = e.currentTarget.closest('.casc-menu-e2e__items-inner');
3208
3208
  if (currentItemsInner !== null) {
3209
3209
  curData.forEach(function (v, col) {
3210
- var colItemsWrapper = currentItemsInner.querySelectorAll('.casc-select-e2e__items-col');
3210
+ var colItemsWrapper = currentItemsInner.querySelectorAll('.casc-menu-e2e__items-col');
3211
3211
  colItemsWrapper.forEach(function (perCol) {
3212
3212
  var _col = Number(perCol.dataset.col);
3213
3213
  if (_col >= level) {
@@ -3743,9 +3743,9 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3743
3743
  };
3744
3744
  }, []);
3745
3745
  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", {
3746
- className: (0,cls.clsWrite)(wrapperClassName, 'casc-select-e2e__wrapper mb-3 position-relative', "casc-select-e2e__wrapper ".concat(wrapperClassName)),
3746
+ className: (0,cls.clsWrite)(wrapperClassName, 'casc-menu-e2e__wrapper mb-3 position-relative', "casc-menu-e2e__wrapper ".concat(wrapperClassName)),
3747
3747
  ref: rootRef,
3748
- "data-overlay-id": "casc-select-e2e__items-wrapper-".concat(idRes)
3748
+ "data-overlay-id": "casc-menu-e2e__items-wrapper-".concat(idRes)
3749
3749
  }, 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", {
3750
3750
  htmlFor: idRes,
3751
3751
  className: "form-label",
@@ -3756,23 +3756,23 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3756
3756
  htmlFor: idRes,
3757
3757
  className: "form-label"
3758
3758
  }, label)) : null, triggerContent ? /*#__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", {
3759
- className: (0,cls.clsWrite)(triggerClassName, 'casc-select-e2e__trigger d-inline w-auto', "casc-select-e2e__trigger ".concat(triggerClassName)),
3759
+ className: (0,cls.clsWrite)(triggerClassName, 'casc-menu-e2e__trigger d-inline w-auto', "casc-menu-e2e__trigger ".concat(triggerClassName)),
3760
3760
  onClick: handleDisplayOptions
3761
3761
  }, triggerContent)) : null, !hasErr ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
3762
3762
  show: true,
3763
3763
  containerClassName: "CascadingSelectE2E"
3764
3764
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3765
3765
  ref: listRef,
3766
- id: "casc-select-e2e__items-wrapper-".concat(idRes),
3767
- className: "casc-select-e2e__items-wrapper position-absolute border shadow small",
3766
+ id: "casc-menu-e2e__items-wrapper-".concat(idRes),
3767
+ className: "casc-menu-e2e__items-wrapper position-absolute border shadow small",
3768
3768
  style: {
3769
3769
  zIndex: DEPTH,
3770
3770
  display: 'none'
3771
3771
  }
3772
3772
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
3773
- className: "casc-select-e2e__items-inner"
3773
+ className: "casc-menu-e2e__items-inner"
3774
3774
  }, loading ? /*#__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", {
3775
- className: "casc-select-e2e__items-loader"
3775
+ className: "casc-menu-e2e__items-loader"
3776
3776
  }, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3777
3777
  height: "12px",
3778
3778
  width: "12px",
@@ -3808,7 +3808,7 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3808
3808
  e.preventDefault();
3809
3809
  cancel();
3810
3810
  },
3811
- className: "casc-select-e2e__close position-absolute top-0 end-0 mt-0 mx-1"
3811
+ className: "casc-menu-e2e__close position-absolute top-0 end-0 mt-0 mx-1"
3812
3812
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3813
3813
  width: "10px",
3814
3814
  height: "10px",
@@ -3829,9 +3829,9 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3829
3829
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
3830
3830
  key: level,
3831
3831
  "data-col": level,
3832
- className: "casc-select-e2e__items-col"
3832
+ className: "casc-menu-e2e__items-col"
3833
3833
  }, searchable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3834
- className: "casc-select-e2e__items-col-searchbox"
3834
+ className: "casc-menu-e2e__items-col-searchbox"
3835
3835
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", {
3836
3836
  type: "text",
3837
3837
  placeholder: searchPlaceholder,
@@ -3857,7 +3857,7 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3857
3857
  return null;
3858
3858
  }
3859
3859
  })))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3860
- className: (0,cls.combinedCls)('casc-select-e2e__val', {
3860
+ className: (0,cls.combinedCls)('casc-menu-e2e__val', {
3861
3861
  'inputable': inputable
3862
3862
  }),
3863
3863
  onClick: handleDisplayOptions
@@ -3880,7 +3880,7 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3880
3880
  }
3881
3881
  },
3882
3882
  id: idRes,
3883
- "data-overlay-id": "casc-select-e2e__items-wrapper-".concat(idRes),
3883
+ "data-overlay-id": "casc-menu-e2e__items-wrapper-".concat(idRes),
3884
3884
  name: name,
3885
3885
  className: (0,cls.combinedCls)((0,cls.clsWrite)(controlClassName, 'form-control'), controlExClassName, {
3886
3886
  'rounded': !propExist(iconLeft) && !propExist(iconRight) && !propExist(units),
@@ -3938,9 +3938,9 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3938
3938
  }
3939
3939
  } : undefined
3940
3940
  }, attributes)), destroyParentIdMatch ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !inputable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3941
- className: "casc-select-e2e__result"
3941
+ className: "casc-menu-e2e__result"
3942
3942
  }, displayInfo(true)) : null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, !inputable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3943
- className: "casc-select-e2e__result"
3943
+ className: "casc-menu-e2e__result"
3944
3944
  }, displayInfo(false)) : null), required ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, requiredLabel || requiredLabel === '' ? requiredLabel : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
3945
3945
  className: "position-absolute end-0 top-0 my-2 mx-2 pe-3"
3946
3946
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
@@ -3950,7 +3950,7 @@ var CascadingSelectE2E = /*#__PURE__*/(0,external_root_React_commonjs2_react_com
3950
3950
  }, units)) : null, propExist(iconRight) ? /*#__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("span", {
3951
3951
  className: (0,cls.clsWrite)(controlGroupTextClassName, 'input-group-text')
3952
3952
  }, iconRight)) : null), isShow ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
3953
- className: "casc-select-e2e__closemask",
3953
+ className: "casc-menu-e2e__closemask",
3954
3954
  onClick: function onClick(e) {
3955
3955
  e.preventDefault();
3956
3956
  cancel();
@@ -3703,54 +3703,92 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3703
3703
  var LIST_CONTAINER_MAX_HEIGHT = 300;
3704
3704
  var keyboardSelectedItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3705
3705
 
3706
+ // loading
3707
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3708
+ _useState2 = _slicedToArray(_useState, 2),
3709
+ fetchLoading = _useState2[0],
3710
+ setFetchLoading = _useState2[1];
3711
+ var loadingOutput = /*#__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", {
3712
+ className: "cus-select-loader"
3713
+ }, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
3714
+ height: "12px",
3715
+ width: "12px",
3716
+ viewBox: "0 0 512 512"
3717
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3718
+ fill: "inherit",
3719
+ d: "M256,0c-23.357,0-42.297,18.932-42.297,42.288c0,23.358,18.94,42.288,42.297,42.288c23.357,0,42.279-18.93,42.279-42.288C298.279,18.932,279.357,0,256,0z"
3720
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3721
+ fill: "inherit",
3722
+ d: "M256,427.424c-23.357,0-42.297,18.931-42.297,42.288C213.703,493.07,232.643,512,256,512c23.357,0,42.279-18.93,42.279-42.288C298.279,446.355,279.357,427.424,256,427.424z"
3723
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3724
+ fill: "inherit",
3725
+ d: "M74.974,74.983c-16.52,16.511-16.52,43.286,0,59.806c16.52,16.52,43.287,16.52,59.806,0c16.52-16.511,16.52-43.286,0-59.806C118.261,58.463,91.494,58.463,74.974,74.983z"
3726
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3727
+ fill: "inherit",
3728
+ d: "M377.203,377.211c-16.503,16.52-16.503,43.296,0,59.815c16.519,16.52,43.304,16.52,59.806,0c16.52-16.51,16.52-43.295,0-59.815C420.489,360.692,393.722,360.7,377.203,377.211z"
3729
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3730
+ fill: "inherit",
3731
+ d: "M84.567,256c0.018-23.348-18.922-42.279-42.279-42.279c-23.357-0.009-42.297,18.932-42.279,42.288c-0.018,23.348,18.904,42.279,42.279,42.279C65.645,298.288,84.567,279.358,84.567,256z"
3732
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3733
+ fill: "inherit",
3734
+ d: "M469.712,213.712c-23.357,0-42.279,18.941-42.297,42.288c0,23.358,18.94,42.288,42.297,42.297c23.357,0,42.297-18.94,42.279-42.297C512.009,232.652,493.069,213.712,469.712,213.712z"
3735
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3736
+ fill: "inherit",
3737
+ d: "M74.991,377.22c-16.519,16.511-16.519,43.296,0,59.806c16.503,16.52,43.27,16.52,59.789,0c16.52-16.519,16.52-43.295,0-59.815C118.278,360.692,91.511,360.692,74.991,377.22z"
3738
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
3739
+ fill: "inherit",
3740
+ d: "M437.026,134.798c16.52-16.52,16.52-43.304,0-59.824c-16.519-16.511-43.304-16.52-59.823,0c-16.52,16.52-16.503,43.295,0,59.815C393.722,151.309,420.507,151.309,437.026,134.798z"
3741
+ })))));
3742
+
3706
3743
  // return a array of options
3707
3744
  var staticOptionsData = optionsRes;
3745
+ var hasDefaultOptions = staticOptionsData.length > 0;
3708
3746
 
3709
3747
  //
3710
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(staticOptionsData),
3711
- _useState2 = _slicedToArray(_useState, 2),
3712
- orginalData = _useState2[0],
3713
- setOrginalData = _useState2[1];
3714
3748
  var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(staticOptionsData),
3715
3749
  _useState4 = _slicedToArray(_useState3, 2),
3716
- optionsData = _useState4[0],
3717
- setOptionsData = _useState4[1];
3718
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3750
+ orginalData = _useState4[0],
3751
+ setOrginalData = _useState4[1];
3752
+ var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(staticOptionsData),
3719
3753
  _useState6 = _slicedToArray(_useState5, 2),
3720
- hasErr = _useState6[0],
3721
- setHasErr = _useState6[1];
3754
+ optionsData = _useState6[0],
3755
+ setOptionsData = _useState6[1];
3756
+ var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3757
+ _useState8 = _slicedToArray(_useState7, 2),
3758
+ hasErr = _useState8[0],
3759
+ setHasErr = _useState8[1];
3722
3760
 
3723
3761
  // Set the final result
3724
- var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
3725
- _useState8 = _slicedToArray(_useState7, 2),
3726
- controlLabel = _useState8[0],
3727
- setControlLabel = _useState8[1];
3728
3762
  var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
3729
3763
  _useState10 = _slicedToArray(_useState9, 2),
3730
- controlValue = _useState10[0],
3731
- setControlValue = _useState10[1];
3764
+ controlLabel = _useState10[0],
3765
+ setControlLabel = _useState10[1];
3766
+ var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
3767
+ _useState12 = _slicedToArray(_useState11, 2),
3768
+ controlValue = _useState12[0],
3769
+ setControlValue = _useState12[1];
3732
3770
 
3733
3771
  //
3734
- var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
3735
- _useState12 = _slicedToArray(_useState11, 2),
3736
- controlTempValue = _useState12[0],
3737
- setControlTempValue = _useState12[1]; // Storage for temporary input
3738
- var _useState13 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3772
+ var _useState13 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
3739
3773
  _useState14 = _slicedToArray(_useState13, 2),
3740
- isOpen = _useState14[0],
3741
- setIsOpen = _useState14[1];
3742
- var _useState15 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
3774
+ controlTempValue = _useState14[0],
3775
+ setControlTempValue = _useState14[1]; // Storage for temporary input
3776
+ var _useState15 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3743
3777
  _useState16 = _slicedToArray(_useState15, 2),
3744
- incomingData = _useState16[0],
3745
- setIncomingData = _useState16[1];
3746
- var _useState17 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3778
+ isOpen = _useState16[0],
3779
+ setIsOpen = _useState16[1];
3780
+ var _useState17 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
3747
3781
  _useState18 = _slicedToArray(_useState17, 2),
3748
- firstRequestExecuted = _useState18[0],
3749
- setFirstRequestExecuted = _useState18[1];
3782
+ incomingData = _useState18[0],
3783
+ setIncomingData = _useState18[1];
3750
3784
  var _useState19 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3751
3785
  _useState20 = _slicedToArray(_useState19, 2),
3752
- handleFirstFetchCompleted = _useState20[0],
3753
- setHandleFirstFetchCompleted = _useState20[1];
3786
+ firstRequestExecuted = _useState20[0],
3787
+ setFirstRequestExecuted = _useState20[1];
3788
+ var _useState21 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3789
+ _useState22 = _slicedToArray(_useState21, 2),
3790
+ handleFirstFetchCompleted = _useState22[0],
3791
+ setHandleFirstFetchCompleted = _useState22[1];
3754
3792
 
3755
3793
  // Mark whether it is out of focus
3756
3794
  // Fixed the issue that caused the pop-up window to still display due to
@@ -3758,25 +3796,25 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3758
3796
  var isBlurringRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
3759
3797
 
3760
3798
  // filter status
3761
- var _useState21 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3762
- _useState22 = _slicedToArray(_useState21, 2),
3763
- filterItemsHasNoMatchData = _useState22[0],
3764
- setFilterItemsHasNoMatchData = _useState22[1];
3799
+ var _useState23 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3800
+ _useState24 = _slicedToArray(_useState23, 2),
3801
+ filterItemsHasNoMatchData = _useState24[0],
3802
+ setFilterItemsHasNoMatchData = _useState24[1];
3765
3803
 
3766
3804
  // blinking cursor
3767
3805
  var BLINKING_CURSOR_STR = '|';
3768
- var _useState23 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
3769
- _useState24 = _slicedToArray(_useState23, 2),
3770
- blinkingPosStart = _useState24[0],
3771
- setBlinkingPosStart = _useState24[1];
3806
+ var _useState25 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
3807
+ _useState26 = _slicedToArray(_useState25, 2),
3808
+ blinkingPosStart = _useState26[0],
3809
+ setBlinkingPosStart = _useState26[1];
3772
3810
  var blinkingPosFauxRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3773
3811
  var blinkingCursorPosDivRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3774
3812
 
3775
3813
  // Select All status (for "Single selection")
3776
- var _useState25 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3777
- _useState26 = _slicedToArray(_useState25, 2),
3778
- userInputboxIsAllSelected = _useState26[0],
3779
- setUserInputboxIsAllSelected = _useState26[1];
3814
+ var _useState27 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3815
+ _useState28 = _slicedToArray(_useState27, 2),
3816
+ userInputboxIsAllSelected = _useState28[0],
3817
+ setUserInputboxIsAllSelected = _useState28[1];
3780
3818
  var selectedSign = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
3781
3819
  var MULTI_SEL_VALID = multiSelect ? multiSelect.valid : false;
3782
3820
  var MULTI_SEL_ENTIRE_AREA_TRIGGER = typeof multiSelectEntireAreaTrigger === 'undefined' ? true : multiSelectEntireAreaTrigger;
@@ -3787,13 +3825,13 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3787
3825
  allItemsLabel: 'All Content ({num})',
3788
3826
  noneLabel: 'No items selected'
3789
3827
  };
3790
- var _useState27 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
3828
+ var _useState29 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
3791
3829
  labels: [],
3792
3830
  values: []
3793
3831
  }),
3794
- _useState28 = _slicedToArray(_useState27, 2),
3795
- controlArr = _useState28[0],
3796
- setControlArr = _useState28[1];
3832
+ _useState30 = _slicedToArray(_useState29, 2),
3833
+ controlArr = _useState30[0],
3834
+ setControlArr = _useState30[1];
3797
3835
 
3798
3836
  // Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
3799
3837
  var isSingleSpecialChar = function isSingleSpecialChar(str) {
@@ -3943,6 +3981,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3943
3981
 
3944
3982
  //performance
3945
3983
  var handleChangeFetchSafe = useDebounce_default()(function (val) {
3984
+ setFetchLoading(true);
3946
3985
  if (fetchUpdate) {
3947
3986
  // update filter status
3948
3987
  setFilterItemsHasNoMatchData(false);
@@ -3954,6 +3993,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3954
3993
  popwinPosInit();
3955
3994
  popwinFilterItems(val);
3956
3995
  }, 0);
3996
+ setFetchLoading(false);
3957
3997
  });
3958
3998
  } else {
3959
3999
  // pop win initalization
@@ -3961,6 +4001,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3961
4001
  popwinPosInit();
3962
4002
  popwinFilterItems(val);
3963
4003
  }, 0);
4004
+ setFetchLoading(false);
3964
4005
  }
3965
4006
  }, 350, [optionsData]);
3966
4007
  function fetchData(_x2, _x3, _x4) {
@@ -4517,10 +4558,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4517
4558
  setIsOpen(false);
4518
4559
  if (!MULTI_SEL_VALID) popwinPosHide();
4519
4560
  if (MANUAL_REQ) {
4520
- // clear data
4521
- setOptionsData([]);
4561
+ // restore to static data
4562
+ setOptionsData(staticOptionsData);
4522
4563
  } else {
4523
- // restore data
4524
4564
  setOptionsData(orginalData);
4525
4565
  }
4526
4566
 
@@ -4576,8 +4616,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4576
4616
  }, 500);
4577
4617
  }
4578
4618
  if (MANUAL_REQ) {
4579
- // clear data
4580
- setOptionsData([]);
4619
+ // display static data
4620
+ setOptionsData(staticOptionsData);
4581
4621
  } else {
4582
4622
  // restore data
4583
4623
  setOptionsData(orginalData);
@@ -4589,7 +4629,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4589
4629
  }
4590
4630
 
4591
4631
  // Every time the input changes or the search button is clicked, a data request will be triggered
4592
- if (MANUAL_REQ && (controlTempValue === '' || controlTempValue === null)) {
4632
+ // !!! If the default data is empty, the pop-up window is not displayed
4633
+ if (MANUAL_REQ && (controlTempValue === '' || controlTempValue === null) && !hasDefaultOptions) {
4593
4634
  setTimeout(function () {
4594
4635
  popwinPosHide();
4595
4636
  }, 0);
@@ -5098,18 +5139,21 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5098
5139
  while (1) switch (_context6.prev = _context6.next) {
5099
5140
  case 0:
5100
5141
  inputVal = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;
5142
+ setFetchLoading(true);
5143
+
5101
5144
  // data init
5102
5145
  searchStr = typeof inputVal === 'string' ? inputVal : controlTempValue || controlTempValue === '' ? controlTempValue : '';
5103
5146
  _oparams = fetchFuncMethodParams || [];
5104
5147
  _params = _oparams.map(function (item) {
5105
5148
  return item !== '$QUERY_STRING' ? item : searchStr;
5106
5149
  });
5107
- _context6.next = 6;
5150
+ _context6.next = 7;
5108
5151
  return fetchData(_params.join(','), '', '', false);
5109
- case 6:
5152
+ case 7:
5110
5153
  res = _context6.sent;
5154
+ setFetchLoading(false);
5111
5155
  return _context6.abrupt("return", res);
5112
- case 8:
5156
+ case 10:
5113
5157
  case "end":
5114
5158
  return _context6.stop();
5115
5159
  }
@@ -5904,7 +5948,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5904
5948
  __html: "".concat(CLEAR_TRIGGER_LABEL)
5905
5949
  },
5906
5950
  onClick: handleClearValue
5907
- }))) : null) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
5951
+ }))) : null) : null, fetchLoading && MANUAL_REQ && hasDefaultOptions ?
5952
+ /*#__PURE__*/
5953
+ // only loading
5954
+ 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("button", {
5955
+ tabIndex: -1,
5956
+ type: "button",
5957
+ className: "list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch",
5958
+ disabled: true
5959
+ }, loadingOutput)) : /*#__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("button", {
5908
5960
  tabIndex: -1,
5909
5961
  type: "button",
5910
5962
  className: "list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch hide",
@@ -5913,37 +5965,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5913
5965
  // (1) Handling async data with the click event
5914
5966
  !FIRST_REQUEST_AUTO && !handleFirstFetchCompleted ||
5915
5967
  // (2) Every time the input changes or the search button is clicked, a data request will be triggered
5916
- fetchUpdate && !filterItemsHasNoMatchData && controlTempValue !== '' ? /*#__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", {
5917
- className: "cus-select-loader"
5918
- }, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
5919
- height: "12px",
5920
- width: "12px",
5921
- viewBox: "0 0 512 512"
5922
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5923
- fill: "inherit",
5924
- d: "M256,0c-23.357,0-42.297,18.932-42.297,42.288c0,23.358,18.94,42.288,42.297,42.288c23.357,0,42.279-18.93,42.279-42.288C298.279,18.932,279.357,0,256,0z"
5925
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5926
- fill: "inherit",
5927
- d: "M256,427.424c-23.357,0-42.297,18.931-42.297,42.288C213.703,493.07,232.643,512,256,512c23.357,0,42.279-18.93,42.279-42.288C298.279,446.355,279.357,427.424,256,427.424z"
5928
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5929
- fill: "inherit",
5930
- d: "M74.974,74.983c-16.52,16.511-16.52,43.286,0,59.806c16.52,16.52,43.287,16.52,59.806,0c16.52-16.511,16.52-43.286,0-59.806C118.261,58.463,91.494,58.463,74.974,74.983z"
5931
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5932
- fill: "inherit",
5933
- d: "M377.203,377.211c-16.503,16.52-16.503,43.296,0,59.815c16.519,16.52,43.304,16.52,59.806,0c16.52-16.51,16.52-43.295,0-59.815C420.489,360.692,393.722,360.7,377.203,377.211z"
5934
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5935
- fill: "inherit",
5936
- d: "M84.567,256c0.018-23.348-18.922-42.279-42.279-42.279c-23.357-0.009-42.297,18.932-42.279,42.288c-0.018,23.348,18.904,42.279,42.279,42.279C65.645,298.288,84.567,279.358,84.567,256z"
5937
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5938
- fill: "inherit",
5939
- d: "M469.712,213.712c-23.357,0-42.279,18.941-42.297,42.288c0,23.358,18.94,42.288,42.297,42.297c23.357,0,42.297-18.94,42.279-42.297C512.009,232.652,493.069,213.712,469.712,213.712z"
5940
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5941
- fill: "inherit",
5942
- d: "M74.991,377.22c-16.519,16.511-16.519,43.296,0,59.806c16.503,16.52,43.27,16.52,59.789,0c16.52-16.519,16.52-43.295,0-59.815C118.278,360.692,91.511,360.692,74.991,377.22z"
5943
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5944
- fill: "inherit",
5945
- d: "M437.026,134.798c16.52-16.52,16.52-43.304,0-59.824c-16.519-16.511-43.304-16.52-59.823,0c-16.52,16.52-16.503,43.295,0,59.815C393.722,151.309,420.507,151.309,437.026,134.798z"
5946
- }))))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, fetchNoneInfo)), optionsData ? optionsData.map(function (item, index) {
5968
+ fetchUpdate && !filterItemsHasNoMatchData && controlTempValue !== '' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, loadingOutput) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, fetchNoneInfo)), optionsData ? optionsData.map(function (item, index) {
5947
5969
  var startItemBorder = index === 0 ? 'border-top-0' : '';
5948
5970
  var endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
5949
5971
 
@@ -6047,7 +6069,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
6047
6069
  }
6048
6070
  })));
6049
6071
  }
6050
- }) : null))))) : null));
6072
+ }) : null)))))) : null));
6051
6073
  });
6052
6074
  /* harmony default export */ const src = (Select);
6053
6075
  })();
@@ -16,9 +16,23 @@ export declare type TooltipProps = {
16
16
  mouseOutDelay?: number;
17
17
  /** Set a piece of text or HTML code */
18
18
  content?: React.ReactNode;
19
+ /** If true, Tooltip is controlled by parent via ref, not by mouse events */
20
+ controlled?: boolean;
21
+ /** Custom color for the popup arrow */
22
+ popupArrowColor?: number[];
23
+ /** Custom style for the popup content */
24
+ popupContentStyle?: React.CSSProperties;
25
+ /** If true, tooltip closes only if mouse does not enter wrapper within timeout after leaving trigger */
26
+ delayedClose?: boolean;
27
+ /** Timeout in ms for delayed close (ms) */
28
+ delayedCloseTimeout?: number;
29
+ /** Called when mouse enters the tooltip wrapper */
30
+ onContentMouseEnter?: (event: React.MouseEvent<HTMLDivElement>) => void;
31
+ /** Called when mouse leaves the tooltip wrapper */
32
+ onContentMouseLeave?: (event: React.MouseEvent<HTMLDivElement>) => void;
19
33
  /** -- */
20
34
  id?: string;
21
35
  children: React.ReactNode;
22
36
  };
23
- declare const Tooltip: (props: TooltipProps) => JSX.Element;
37
+ declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<any>>;
24
38
  export default Tooltip;