funda-ui 4.7.275 → 4.7.333

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.
@@ -18,7 +18,6 @@ export declare type LiveSearchProps = {
18
18
  exceededSidePosOffset?: number;
19
19
  appearance?: string;
20
20
  isSearchInput?: boolean;
21
- allowSpacingRetrive?: boolean;
22
21
  loader?: React.ReactNode;
23
22
  value?: string;
24
23
  label?: React.ReactNode | string;
@@ -2802,7 +2802,7 @@ __webpack_require__.r(__webpack_exports__);
2802
2802
  /* harmony import */ var funda_utils_dist_cjs_getElementProperty__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_getElementProperty__WEBPACK_IMPORTED_MODULE_8__);
2803
2803
  /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(188);
2804
2804
  /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_9__);
2805
- var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "exceededSidePosOffset", "appearance", "isSearchInput", "allowSpacingRetrive", "loader", "readOnly", "disabled", "required", "placeholder", "noMatchPopup", "options", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "id", "autoComplete", "autoCapitalize", "spellCheck", "icon", "btnId", "fetchTrigger", "hideIcon", "renderOption", "depth", "style", "winWidth", "tabIndex", "data", "autoShowOptions", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onClick", "onFetch", "onChange", "onKeyboardInput", "onBlur", "onPressEnter"];
2805
+ var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "exceededSidePosOffset", "appearance", "isSearchInput", "loader", "readOnly", "disabled", "required", "placeholder", "noMatchPopup", "options", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "id", "autoComplete", "autoCapitalize", "spellCheck", "icon", "btnId", "fetchTrigger", "hideIcon", "renderOption", "depth", "style", "winWidth", "tabIndex", "data", "autoShowOptions", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onClick", "onFetch", "onChange", "onKeyboardInput", "onBlur", "onPressEnter"];
2806
2806
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2807
2807
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2808
2808
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -2842,7 +2842,6 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
2842
2842
  exceededSidePosOffset = props.exceededSidePosOffset,
2843
2843
  appearance = props.appearance,
2844
2844
  isSearchInput = props.isSearchInput,
2845
- allowSpacingRetrive = props.allowSpacingRetrive,
2846
2845
  loader = props.loader,
2847
2846
  readOnly = props.readOnly,
2848
2847
  disabled = props.disabled,
@@ -3002,6 +3001,11 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3002
3001
  }
3003
3002
  }, [isOpen, rootRef, listRef]);
3004
3003
 
3004
+ // Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
3005
+ var isSingleSpecialChar = function isSingleSpecialChar(str) {
3006
+ return typeof str === 'string' && /^[^\w\s]$/.test(str);
3007
+ };
3008
+
3005
3009
  // Add function to the element that should be used as the scrollable area.
3006
3010
  var _useWindowScroll = funda_utils_dist_cjs_useWindowScroll__WEBPACK_IMPORTED_MODULE_5___default()({
3007
3011
  performance: ['debounce', 500],
@@ -3173,12 +3177,29 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3173
3177
  // Avoid fatal errors causing page crashes
3174
3178
  var _queryString = typeof item.queryString !== 'undefined' && item.queryString !== null ? item.queryString : '';
3175
3179
  var _val = typeof val !== 'undefined' && val !== null ? val : '';
3176
- if (emptyValShowAll && val === '') {
3180
+
3181
+ // STEP 1
3182
+ //========
3183
+ if (emptyValShowAll && _val === '') {
3177
3184
  return true;
3178
3185
  }
3179
- if (allowSpacingRetrive && val == ' ') {
3186
+
3187
+ // STEP 2
3188
+ //========
3189
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
3190
+ if (query && _val == ' ') {
3180
3191
  return true;
3181
3192
  }
3193
+
3194
+ // STEP 3
3195
+ //========
3196
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
3197
+ if (query && _val != '' && isSingleSpecialChar(_val)) {
3198
+ return true;
3199
+ }
3200
+
3201
+ // STEP 4
3202
+ //========
3182
3203
  if ((_queryString.split(',').some(function (l) {
3183
3204
  return l.charAt(0) === _val.toLowerCase();
3184
3205
  }) || _queryString.split(',').some(function (l) {
package/Select/index.css CHANGED
@@ -16,6 +16,7 @@
16
16
  --cus-sel-searchbtn-hover-fill: #333;
17
17
  --cus-sel-removebtn-fill: #000;
18
18
  --cus-sel-removebtn-hover-fill: #f00;
19
+ --cus-sel-selected-color:#b1d0ff;
19
20
  position: relative; /* Required */
20
21
  /*------ Placeholder for input ------*/
21
22
  /*------ Arrow ------*/
@@ -85,11 +86,15 @@
85
86
  display: inline-block;
86
87
  color: var(--cus-sel-placeholder-color);
87
88
  width: 100%;
89
+ /* Select all highlights (for "Single selection") */
88
90
  /* Text preview */
89
91
  }
90
92
  .custom-select__wrapper .custom-select-multi__control-blinking-cursor.animated {
91
93
  animation: 1s mf-sel-blink step-end infinite;
92
94
  }
95
+ .custom-select__wrapper .custom-select-multi__control-blinking-cursor.selected > span {
96
+ background-color: var(--cus-sel-selected-color);
97
+ }
93
98
  .custom-select__wrapper .custom-select-multi__control-blinking-cursor.control-placeholder {
94
99
  color: var(--cus-sel-input-placeholder-color);
95
100
  }
package/Select/index.js CHANGED
@@ -3771,6 +3771,12 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3771
3771
  setBlinkingPosStart = _useState24[1];
3772
3772
  var blinkingPosFauxRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3773
3773
  var blinkingCursorPosDivRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3774
+
3775
+ // 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];
3774
3780
  var selectedSign = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
3775
3781
  var MULTI_SEL_VALID = multiSelect ? multiSelect.valid : false;
3776
3782
  var MULTI_SEL_ENTIRE_AREA_TRIGGER = typeof multiSelectEntireAreaTrigger === 'undefined' ? true : multiSelectEntireAreaTrigger;
@@ -3781,16 +3787,21 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3781
3787
  allItemsLabel: 'All Content ({num})',
3782
3788
  noneLabel: 'No items selected'
3783
3789
  };
3784
- var _useState25 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
3790
+ var _useState27 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
3785
3791
  labels: [],
3786
3792
  values: []
3787
3793
  }),
3788
- _useState26 = _slicedToArray(_useState25, 2),
3789
- controlArr = _useState26[0],
3790
- setControlArr = _useState26[1];
3791
- function chkValueExist(v) {
3794
+ _useState28 = _slicedToArray(_useState27, 2),
3795
+ controlArr = _useState28[0],
3796
+ setControlArr = _useState28[1];
3797
+
3798
+ // Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
3799
+ var isSingleSpecialChar = function isSingleSpecialChar(str) {
3800
+ return typeof str === 'string' && /^[^\w\s]$/.test(str);
3801
+ };
3802
+ var chkValueExist = function chkValueExist(v) {
3792
3803
  return typeof v !== 'undefined' && v !== '';
3793
- }
3804
+ };
3794
3805
  var listContainerHeightLimit = function listContainerHeightLimit(num) {
3795
3806
  var res = num;
3796
3807
  if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
@@ -3929,35 +3940,12 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3929
3940
 
3930
3941
  //performance
3931
3942
  var handleChangeFetchSafe = useDebounce_default()(function (val) {
3932
- var _orginalData = [];
3933
- var update = function update(inputData) {
3934
- var filterRes = function filterRes() {
3935
- return inputData.filter(function (item) {
3936
- // Avoid fatal errors causing page crashes
3937
- var _queryString = typeof item.queryString !== 'undefined' && item.queryString !== null ? item.queryString : '';
3938
- var _val = typeof val !== 'undefined' && val !== null ? val : '';
3939
- if ((_queryString.split(',').some(function (l) {
3940
- return l.charAt(0) === _val.toLowerCase();
3941
- }) || _queryString.split(',').some(function (l) {
3942
- return l.replace(/ /g, '').indexOf(_val.toLowerCase()) >= 0;
3943
- }) || item.label.toLowerCase().indexOf(_val.toLowerCase()) >= 0) && _val != '') {
3944
- return true;
3945
- } else {
3946
- return false;
3947
- }
3948
- });
3949
- };
3950
- return filterRes();
3951
- };
3952
3943
  if (fetchUpdate) {
3953
3944
  // update filter status
3954
3945
  setFilterItemsHasNoMatchData(false);
3955
3946
 
3956
3947
  // Make a request
3957
3948
  handleFetch(val).then(function (response) {
3958
- _orginalData = response;
3959
- var _filterRes = update(_orginalData);
3960
-
3961
3949
  // pop win initalization
3962
3950
  setTimeout(function () {
3963
3951
  popwinPosInit();
@@ -3965,9 +3953,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3965
3953
  }, 0);
3966
3954
  });
3967
3955
  } else {
3968
- _orginalData = orginalData;
3969
- var _filterRes = update(_orginalData);
3970
-
3971
3956
  // pop win initalization
3972
3957
  setTimeout(function () {
3973
3958
  popwinPosInit();
@@ -3990,7 +3975,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3990
3975
  _currentData,
3991
3976
  _defaultValues,
3992
3977
  _defaultLabels,
3993
- _filterRes2,
3978
+ _filterRes,
3994
3979
  _filterResQueryValue,
3995
3980
  _filterResQueryLabel,
3996
3981
  _currentData2,
@@ -4132,19 +4117,19 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4132
4117
 
4133
4118
  // STEP 3: ===========
4134
4119
  // If the default value is label, match value
4135
- _filterRes2 = [];
4120
+ _filterRes = [];
4136
4121
  _filterResQueryValue = staticOptionsData.filter(function (item) {
4137
4122
  return item.value == defaultValue;
4138
4123
  });
4139
4124
  _filterResQueryLabel = staticOptionsData.filter(function (item) {
4140
4125
  return item.label == defaultValue;
4141
4126
  });
4142
- _filterRes2 = _filterResQueryValue;
4143
- if (_filterResQueryValue.length === 0) _filterRes2 = _filterResQueryLabel;
4127
+ _filterRes = _filterResQueryValue;
4128
+ if (_filterResQueryValue.length === 0) _filterRes = _filterResQueryLabel;
4144
4129
 
4145
4130
  // if the default value is Object
4146
- if (isObject(inputDefault) && _filterRes2.length === 0) {
4147
- _filterRes2 = [inputDefault];
4131
+ if (isObject(inputDefault) && _filterRes.length === 0) {
4132
+ _filterRes = [inputDefault];
4148
4133
  }
4149
4134
 
4150
4135
  // STEP 4: ===========
@@ -4156,9 +4141,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4156
4141
  setControlValue('');
4157
4142
  setControlLabel('');
4158
4143
  } else {
4159
- if (_filterRes2.length > 0) {
4160
- setControlValue(_filterRes2[0].value);
4161
- setControlLabel(formatIndentVal(_filterRes2[0].label, INDENT_LAST_PLACEHOLDER));
4144
+ if (_filterRes.length > 0) {
4145
+ setControlValue(_filterRes[0].value);
4146
+ setControlLabel(formatIndentVal(_filterRes[0].label, INDENT_LAST_PLACEHOLDER));
4162
4147
  }
4163
4148
  }
4164
4149
 
@@ -4426,6 +4411,25 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4426
4411
  // Avoid fatal errors causing page crashes
4427
4412
  var _queryString = typeof node.dataset.querystring !== 'undefined' && node.dataset.querystring !== null ? node.dataset.querystring : '';
4428
4413
  var _val = typeof val !== 'undefined' && val !== null ? val : '';
4414
+
4415
+ // STEP 1
4416
+ //========
4417
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
4418
+ // If the condition is true, skip the loop and move on to the next node.
4419
+ if (fetchUpdate && _val == ' ') {
4420
+ return;
4421
+ }
4422
+
4423
+ // STEP 2
4424
+ //========
4425
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
4426
+ // If the condition is true, skip the loop and move on to the next node.
4427
+ if (fetchUpdate && _val != '' && isSingleSpecialChar(_val)) {
4428
+ return;
4429
+ }
4430
+
4431
+ // STEP 3
4432
+ //========
4429
4433
  if ((_queryString.split(',').some(function (l) {
4430
4434
  return l.charAt(0) === _val.toLowerCase();
4431
4435
  }) || _queryString.split(',').some(function (l) {
@@ -4523,6 +4527,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4523
4527
  // update filter status
4524
4528
  setFilterItemsHasNoMatchData(false);
4525
4529
 
4530
+ // reset Select All status (for "Single selection")
4531
+ setUserInputboxIsAllSelected(false);
4532
+
4526
4533
  // Unlocks the page
4527
4534
  if (LOCK_BODY_SCROLL) (0,bodyScrollLock.enableBodyScroll)(document.querySelector('body'));
4528
4535
  }
@@ -5498,6 +5505,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5498
5505
  };
5499
5506
  }, [orginalData]); // Avoid the issue that `setOptionsData(orginalData)` sets the original value to empty on the first entry
5500
5507
 
5508
+ // Select all detection functions in the input box (for "Single selection")
5509
+ function checkUserInputboxIsAllSelected(e) {
5510
+ var input = e.target;
5511
+ if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
5512
+ setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
5513
+ } else {
5514
+ setUserInputboxIsAllSelected(false);
5515
+ }
5516
+ }
5501
5517
  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, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
5502
5518
  className: "custom-select__label"
5503
5519
  }, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
@@ -5612,7 +5628,18 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5612
5628
  autoComplete: typeof autoComplete === 'undefined' ? 'off' : autoComplete,
5613
5629
  autoCapitalize: typeof autoCapitalize === 'undefined' ? 'off' : autoCapitalize,
5614
5630
  spellCheck: typeof spellCheck === 'undefined' ? false : spellCheck
5615
- }, attributes)))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
5631
+ }, attributes, {
5632
+ // Select all detection (for "Single selection")
5633
+ onSelect: function onSelect(e) {
5634
+ checkUserInputboxIsAllSelected(e);
5635
+ },
5636
+ onKeyUp: function onKeyUp(e) {
5637
+ checkUserInputboxIsAllSelected(e);
5638
+ },
5639
+ onMouseUp: function onMouseUp(e) {
5640
+ checkUserInputboxIsAllSelected(e);
5641
+ }
5642
+ })))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
5616
5643
  ref: valueInputRef,
5617
5644
  tabIndex: -1,
5618
5645
  type: "hidden",
@@ -5642,7 +5669,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5642
5669
  }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
5643
5670
  ref: blinkingCursorPosDivRef,
5644
5671
  className: (0,cls.combinedCls)('custom-select-multi__control-blinking-cursor', {
5645
- 'animated': generateInputFocusStr() === BLINKING_CURSOR_STR
5672
+ 'animated': generateInputFocusStr() === BLINKING_CURSOR_STR,
5673
+ // Select all highlights (for "Single selection")
5674
+ 'selected': userInputboxIsAllSelected
5646
5675
  })
5647
5676
  }, controlTempValue || controlTempValue === '' ? controlTempValue.length === 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
5648
5677
  className: "".concat(!hideBlinkingCursor() ? 'control-placeholder' : '')
@@ -18,7 +18,6 @@ export declare type LiveSearchProps = {
18
18
  exceededSidePosOffset?: number;
19
19
  appearance?: string;
20
20
  isSearchInput?: boolean;
21
- allowSpacingRetrive?: boolean;
22
21
  loader?: React.ReactNode;
23
22
  value?: string;
24
23
  label?: React.ReactNode | string;
@@ -2802,7 +2802,7 @@ __webpack_require__.r(__webpack_exports__);
2802
2802
  /* harmony import */ var funda_utils_dist_cjs_getElementProperty__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_getElementProperty__WEBPACK_IMPORTED_MODULE_8__);
2803
2803
  /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(188);
2804
2804
  /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_9__);
2805
- var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "exceededSidePosOffset", "appearance", "isSearchInput", "allowSpacingRetrive", "loader", "readOnly", "disabled", "required", "placeholder", "noMatchPopup", "options", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "id", "autoComplete", "autoCapitalize", "spellCheck", "icon", "btnId", "fetchTrigger", "hideIcon", "renderOption", "depth", "style", "winWidth", "tabIndex", "data", "autoShowOptions", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onClick", "onFetch", "onChange", "onKeyboardInput", "onBlur", "onPressEnter"];
2805
+ var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "controlGroupWrapperClassName", "controlGroupTextClassName", "exceededSidePosOffset", "appearance", "isSearchInput", "loader", "readOnly", "disabled", "required", "placeholder", "noMatchPopup", "options", "value", "label", "name", "units", "iconLeft", "iconRight", "minLength", "maxLength", "id", "autoComplete", "autoCapitalize", "spellCheck", "icon", "btnId", "fetchTrigger", "hideIcon", "renderOption", "depth", "style", "winWidth", "tabIndex", "data", "autoShowOptions", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "fetchCallback", "onClick", "onFetch", "onChange", "onKeyboardInput", "onBlur", "onPressEnter"];
2806
2806
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2807
2807
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2808
2808
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -2842,7 +2842,6 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
2842
2842
  exceededSidePosOffset = props.exceededSidePosOffset,
2843
2843
  appearance = props.appearance,
2844
2844
  isSearchInput = props.isSearchInput,
2845
- allowSpacingRetrive = props.allowSpacingRetrive,
2846
2845
  loader = props.loader,
2847
2846
  readOnly = props.readOnly,
2848
2847
  disabled = props.disabled,
@@ -3002,6 +3001,11 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3002
3001
  }
3003
3002
  }, [isOpen, rootRef, listRef]);
3004
3003
 
3004
+ // Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
3005
+ var isSingleSpecialChar = function isSingleSpecialChar(str) {
3006
+ return typeof str === 'string' && /^[^\w\s]$/.test(str);
3007
+ };
3008
+
3005
3009
  // Add function to the element that should be used as the scrollable area.
3006
3010
  var _useWindowScroll = funda_utils_dist_cjs_useWindowScroll__WEBPACK_IMPORTED_MODULE_5___default()({
3007
3011
  performance: ['debounce', 500],
@@ -3173,12 +3177,29 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
3173
3177
  // Avoid fatal errors causing page crashes
3174
3178
  var _queryString = typeof item.queryString !== 'undefined' && item.queryString !== null ? item.queryString : '';
3175
3179
  var _val = typeof val !== 'undefined' && val !== null ? val : '';
3176
- if (emptyValShowAll && val === '') {
3180
+
3181
+ // STEP 1
3182
+ //========
3183
+ if (emptyValShowAll && _val === '') {
3177
3184
  return true;
3178
3185
  }
3179
- if (allowSpacingRetrive && val == ' ') {
3186
+
3187
+ // STEP 2
3188
+ //========
3189
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
3190
+ if (query && _val == ' ') {
3180
3191
  return true;
3181
3192
  }
3193
+
3194
+ // STEP 3
3195
+ //========
3196
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
3197
+ if (query && _val != '' && isSingleSpecialChar(_val)) {
3198
+ return true;
3199
+ }
3200
+
3201
+ // STEP 4
3202
+ //========
3182
3203
  if ((_queryString.split(',').some(function (l) {
3183
3204
  return l.charAt(0) === _val.toLowerCase();
3184
3205
  }) || _queryString.split(',').some(function (l) {
@@ -3771,6 +3771,12 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3771
3771
  setBlinkingPosStart = _useState24[1];
3772
3772
  var blinkingPosFauxRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3773
3773
  var blinkingCursorPosDivRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3774
+
3775
+ // 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];
3774
3780
  var selectedSign = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
3775
3781
  var MULTI_SEL_VALID = multiSelect ? multiSelect.valid : false;
3776
3782
  var MULTI_SEL_ENTIRE_AREA_TRIGGER = typeof multiSelectEntireAreaTrigger === 'undefined' ? true : multiSelectEntireAreaTrigger;
@@ -3781,16 +3787,21 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3781
3787
  allItemsLabel: 'All Content ({num})',
3782
3788
  noneLabel: 'No items selected'
3783
3789
  };
3784
- var _useState25 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
3790
+ var _useState27 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
3785
3791
  labels: [],
3786
3792
  values: []
3787
3793
  }),
3788
- _useState26 = _slicedToArray(_useState25, 2),
3789
- controlArr = _useState26[0],
3790
- setControlArr = _useState26[1];
3791
- function chkValueExist(v) {
3794
+ _useState28 = _slicedToArray(_useState27, 2),
3795
+ controlArr = _useState28[0],
3796
+ setControlArr = _useState28[1];
3797
+
3798
+ // Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
3799
+ var isSingleSpecialChar = function isSingleSpecialChar(str) {
3800
+ return typeof str === 'string' && /^[^\w\s]$/.test(str);
3801
+ };
3802
+ var chkValueExist = function chkValueExist(v) {
3792
3803
  return typeof v !== 'undefined' && v !== '';
3793
- }
3804
+ };
3794
3805
  var listContainerHeightLimit = function listContainerHeightLimit(num) {
3795
3806
  var res = num;
3796
3807
  if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
@@ -3929,35 +3940,12 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3929
3940
 
3930
3941
  //performance
3931
3942
  var handleChangeFetchSafe = useDebounce_default()(function (val) {
3932
- var _orginalData = [];
3933
- var update = function update(inputData) {
3934
- var filterRes = function filterRes() {
3935
- return inputData.filter(function (item) {
3936
- // Avoid fatal errors causing page crashes
3937
- var _queryString = typeof item.queryString !== 'undefined' && item.queryString !== null ? item.queryString : '';
3938
- var _val = typeof val !== 'undefined' && val !== null ? val : '';
3939
- if ((_queryString.split(',').some(function (l) {
3940
- return l.charAt(0) === _val.toLowerCase();
3941
- }) || _queryString.split(',').some(function (l) {
3942
- return l.replace(/ /g, '').indexOf(_val.toLowerCase()) >= 0;
3943
- }) || item.label.toLowerCase().indexOf(_val.toLowerCase()) >= 0) && _val != '') {
3944
- return true;
3945
- } else {
3946
- return false;
3947
- }
3948
- });
3949
- };
3950
- return filterRes();
3951
- };
3952
3943
  if (fetchUpdate) {
3953
3944
  // update filter status
3954
3945
  setFilterItemsHasNoMatchData(false);
3955
3946
 
3956
3947
  // Make a request
3957
3948
  handleFetch(val).then(function (response) {
3958
- _orginalData = response;
3959
- var _filterRes = update(_orginalData);
3960
-
3961
3949
  // pop win initalization
3962
3950
  setTimeout(function () {
3963
3951
  popwinPosInit();
@@ -3965,9 +3953,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3965
3953
  }, 0);
3966
3954
  });
3967
3955
  } else {
3968
- _orginalData = orginalData;
3969
- var _filterRes = update(_orginalData);
3970
-
3971
3956
  // pop win initalization
3972
3957
  setTimeout(function () {
3973
3958
  popwinPosInit();
@@ -3990,7 +3975,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3990
3975
  _currentData,
3991
3976
  _defaultValues,
3992
3977
  _defaultLabels,
3993
- _filterRes2,
3978
+ _filterRes,
3994
3979
  _filterResQueryValue,
3995
3980
  _filterResQueryLabel,
3996
3981
  _currentData2,
@@ -4132,19 +4117,19 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4132
4117
 
4133
4118
  // STEP 3: ===========
4134
4119
  // If the default value is label, match value
4135
- _filterRes2 = [];
4120
+ _filterRes = [];
4136
4121
  _filterResQueryValue = staticOptionsData.filter(function (item) {
4137
4122
  return item.value == defaultValue;
4138
4123
  });
4139
4124
  _filterResQueryLabel = staticOptionsData.filter(function (item) {
4140
4125
  return item.label == defaultValue;
4141
4126
  });
4142
- _filterRes2 = _filterResQueryValue;
4143
- if (_filterResQueryValue.length === 0) _filterRes2 = _filterResQueryLabel;
4127
+ _filterRes = _filterResQueryValue;
4128
+ if (_filterResQueryValue.length === 0) _filterRes = _filterResQueryLabel;
4144
4129
 
4145
4130
  // if the default value is Object
4146
- if (isObject(inputDefault) && _filterRes2.length === 0) {
4147
- _filterRes2 = [inputDefault];
4131
+ if (isObject(inputDefault) && _filterRes.length === 0) {
4132
+ _filterRes = [inputDefault];
4148
4133
  }
4149
4134
 
4150
4135
  // STEP 4: ===========
@@ -4156,9 +4141,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4156
4141
  setControlValue('');
4157
4142
  setControlLabel('');
4158
4143
  } else {
4159
- if (_filterRes2.length > 0) {
4160
- setControlValue(_filterRes2[0].value);
4161
- setControlLabel(formatIndentVal(_filterRes2[0].label, INDENT_LAST_PLACEHOLDER));
4144
+ if (_filterRes.length > 0) {
4145
+ setControlValue(_filterRes[0].value);
4146
+ setControlLabel(formatIndentVal(_filterRes[0].label, INDENT_LAST_PLACEHOLDER));
4162
4147
  }
4163
4148
  }
4164
4149
 
@@ -4426,6 +4411,25 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4426
4411
  // Avoid fatal errors causing page crashes
4427
4412
  var _queryString = typeof node.dataset.querystring !== 'undefined' && node.dataset.querystring !== null ? node.dataset.querystring : '';
4428
4413
  var _val = typeof val !== 'undefined' && val !== null ? val : '';
4414
+
4415
+ // STEP 1
4416
+ //========
4417
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
4418
+ // If the condition is true, skip the loop and move on to the next node.
4419
+ if (fetchUpdate && _val == ' ') {
4420
+ return;
4421
+ }
4422
+
4423
+ // STEP 2
4424
+ //========
4425
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
4426
+ // If the condition is true, skip the loop and move on to the next node.
4427
+ if (fetchUpdate && _val != '' && isSingleSpecialChar(_val)) {
4428
+ return;
4429
+ }
4430
+
4431
+ // STEP 3
4432
+ //========
4429
4433
  if ((_queryString.split(',').some(function (l) {
4430
4434
  return l.charAt(0) === _val.toLowerCase();
4431
4435
  }) || _queryString.split(',').some(function (l) {
@@ -4523,6 +4527,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4523
4527
  // update filter status
4524
4528
  setFilterItemsHasNoMatchData(false);
4525
4529
 
4530
+ // reset Select All status (for "Single selection")
4531
+ setUserInputboxIsAllSelected(false);
4532
+
4526
4533
  // Unlocks the page
4527
4534
  if (LOCK_BODY_SCROLL) (0,bodyScrollLock.enableBodyScroll)(document.querySelector('body'));
4528
4535
  }
@@ -5498,6 +5505,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5498
5505
  };
5499
5506
  }, [orginalData]); // Avoid the issue that `setOptionsData(orginalData)` sets the original value to empty on the first entry
5500
5507
 
5508
+ // Select all detection functions in the input box (for "Single selection")
5509
+ function checkUserInputboxIsAllSelected(e) {
5510
+ var input = e.target;
5511
+ if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
5512
+ setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
5513
+ } else {
5514
+ setUserInputboxIsAllSelected(false);
5515
+ }
5516
+ }
5501
5517
  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, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
5502
5518
  className: "custom-select__label"
5503
5519
  }, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
@@ -5612,7 +5628,18 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5612
5628
  autoComplete: typeof autoComplete === 'undefined' ? 'off' : autoComplete,
5613
5629
  autoCapitalize: typeof autoCapitalize === 'undefined' ? 'off' : autoCapitalize,
5614
5630
  spellCheck: typeof spellCheck === 'undefined' ? false : spellCheck
5615
- }, attributes)))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
5631
+ }, attributes, {
5632
+ // Select all detection (for "Single selection")
5633
+ onSelect: function onSelect(e) {
5634
+ checkUserInputboxIsAllSelected(e);
5635
+ },
5636
+ onKeyUp: function onKeyUp(e) {
5637
+ checkUserInputboxIsAllSelected(e);
5638
+ },
5639
+ onMouseUp: function onMouseUp(e) {
5640
+ checkUserInputboxIsAllSelected(e);
5641
+ }
5642
+ })))) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", _extends({
5616
5643
  ref: valueInputRef,
5617
5644
  tabIndex: -1,
5618
5645
  type: "hidden",
@@ -5642,7 +5669,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5642
5669
  }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
5643
5670
  ref: blinkingCursorPosDivRef,
5644
5671
  className: (0,cls.combinedCls)('custom-select-multi__control-blinking-cursor', {
5645
- 'animated': generateInputFocusStr() === BLINKING_CURSOR_STR
5672
+ 'animated': generateInputFocusStr() === BLINKING_CURSOR_STR,
5673
+ // Select all highlights (for "Single selection")
5674
+ 'selected': userInputboxIsAllSelected
5646
5675
  })
5647
5676
  }, controlTempValue || controlTempValue === '' ? controlTempValue.length === 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
5648
5677
  className: "".concat(!hideBlinkingCursor() ? 'control-placeholder' : '')
@@ -16,6 +16,7 @@
16
16
  --cus-sel-searchbtn-hover-fill: #333;
17
17
  --cus-sel-removebtn-fill: #000;
18
18
  --cus-sel-removebtn-hover-fill: #f00;
19
+ --cus-sel-selected-color:#b1d0ff;
19
20
  position: relative; /* Required */
20
21
  /*------ Placeholder for input ------*/
21
22
  /*------ Arrow ------*/
@@ -85,11 +86,15 @@
85
86
  display: inline-block;
86
87
  color: var(--cus-sel-placeholder-color);
87
88
  width: 100%;
89
+ /* Select all highlights (for "Single selection") */
88
90
  /* Text preview */
89
91
  }
90
92
  .custom-select__wrapper .custom-select-multi__control-blinking-cursor.animated {
91
93
  animation: 1s mf-sel-blink step-end infinite;
92
94
  }
95
+ .custom-select__wrapper .custom-select-multi__control-blinking-cursor.selected > span {
96
+ background-color: var(--cus-sel-selected-color);
97
+ }
93
98
  .custom-select__wrapper .custom-select-multi__control-blinking-cursor.control-placeholder {
94
99
  color: var(--cus-sel-input-placeholder-color);
95
100
  }
@@ -17,6 +17,7 @@ import {
17
17
  import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
18
18
 
19
19
 
20
+
20
21
  export interface OptionConfig {
21
22
  disabled?: boolean;
22
23
  label: any;
@@ -38,7 +39,6 @@ export type LiveSearchProps = {
38
39
  exceededSidePosOffset?: number;
39
40
  appearance?: string;
40
41
  isSearchInput?: boolean;
41
- allowSpacingRetrive?: boolean;
42
42
  loader?: React.ReactNode;
43
43
  value?: string;
44
44
  label?: React.ReactNode | string;
@@ -101,7 +101,6 @@ const LiveSearch = forwardRef((props: LiveSearchProps, externalRef: any) => {
101
101
  exceededSidePosOffset,
102
102
  appearance,
103
103
  isSearchInput,
104
- allowSpacingRetrive,
105
104
  loader,
106
105
  readOnly,
107
106
  disabled,
@@ -253,6 +252,10 @@ const LiveSearch = forwardRef((props: LiveSearchProps, externalRef: any) => {
253
252
 
254
253
 
255
254
 
255
+ // Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
256
+ const isSingleSpecialChar = (str: string) => {
257
+ return typeof str === 'string' && /^[^\w\s]$/.test(str);
258
+ };
256
259
 
257
260
 
258
261
  // Add function to the element that should be used as the scrollable area.
@@ -435,6 +438,7 @@ const LiveSearch = forwardRef((props: LiveSearchProps, externalRef: any) => {
435
438
  //
436
439
  async function matchData(val: string = '', query: boolean = false, emptyValShowAll: boolean = false) {
437
440
 
441
+
438
442
  let res: any[] = [];
439
443
  let filterRes = (data: any[]) => {
440
444
  return data.filter((item: any) => {
@@ -443,15 +447,31 @@ const LiveSearch = forwardRef((props: LiveSearchProps, externalRef: any) => {
443
447
  const _queryString = typeof item.queryString !== 'undefined' && item.queryString !== null ? item.queryString : '';
444
448
  const _val = typeof val !== 'undefined' && val !== null ? val : '';
445
449
 
446
-
447
- if (emptyValShowAll && val === '') {
450
+ // STEP 1
451
+ //========
452
+ if (emptyValShowAll && _val === '') {
448
453
  return true;
449
454
  }
450
455
 
451
- if (allowSpacingRetrive && val == ' ') {
456
+
457
+ // STEP 2
458
+ //========
459
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
460
+ if (query && _val == ' ') {
452
461
  return true;
453
462
  }
454
-
463
+
464
+
465
+ // STEP 3
466
+ //========
467
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
468
+ if (query && _val != '' && isSingleSpecialChar(_val)) {
469
+ return true;
470
+ }
471
+
472
+
473
+ // STEP 4
474
+ //========
455
475
  if (
456
476
  (
457
477
  _queryString.split(',').some((l: any) => l.charAt(0) === _val.toLowerCase()) ||
@@ -3,8 +3,6 @@ import React, { useState, useEffect, useRef, ChangeEvent, MouseEvent, Compositio
3
3
  import useComId from 'funda-utils/dist/cjs/useComId';
4
4
  import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
5
5
 
6
-
7
-
8
6
  export type SearchBarProps = {
9
7
  wrapperClassName?: string;
10
8
  controlClassName?: string;
@@ -18,6 +18,7 @@
18
18
  --cus-sel-searchbtn-hover-fill: #333;
19
19
  --cus-sel-removebtn-fill: #000;
20
20
  --cus-sel-removebtn-hover-fill: #f00;
21
+ --cus-sel-selected-color:#b1d0ff;
21
22
 
22
23
 
23
24
  position: relative; /* Required */
@@ -115,6 +116,13 @@
115
116
  animation: 1s mf-sel-blink step-end infinite;
116
117
  }
117
118
 
119
+
120
+ /* Select all highlights (for "Single selection") */
121
+ &.selected > span {
122
+ background-color: var(--cus-sel-selected-color);
123
+ }
124
+
125
+
118
126
  &.control-placeholder {
119
127
  color: var(--cus-sel-input-placeholder-color);
120
128
  }
@@ -2,7 +2,6 @@ import React, { useEffect, useState, useRef, KeyboardEvent, forwardRef, useImper
2
2
 
3
3
  import {
4
4
  formatIndentVal,
5
- unique,
6
5
  removeItemOnce,
7
6
  optionsCustomSelectFlat,
8
7
  isObject
@@ -19,9 +18,6 @@ import {
19
18
  import useDebounce from 'funda-utils/dist/cjs/useDebounce';
20
19
  import useClickOutside from 'funda-utils/dist/cjs/useClickOutside';
21
20
  import useWindowScroll from 'funda-utils/dist/cjs/useWindowScroll';
22
- import {
23
- extractContentsOfBrackets
24
- } from 'funda-utils/dist/cjs/extract';
25
21
  import {
26
22
  convertArrToValByBrackets
27
23
  } from 'funda-utils/dist/cjs/convert';
@@ -52,7 +48,6 @@ import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
52
48
 
53
49
 
54
50
 
55
-
56
51
  export interface MultiSelectValue {
57
52
  items: { label: string; value: string }[];
58
53
  labels: string[];
@@ -308,6 +303,9 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
308
303
  const blinkingPosFauxRef = useRef<any>(null);
309
304
  const blinkingCursorPosDivRef = useRef<any>(null);
310
305
 
306
+ // Select All status (for "Single selection")
307
+ const [userInputboxIsAllSelected, setUserInputboxIsAllSelected] = useState(false);
308
+
311
309
 
312
310
 
313
311
  const selectedSign = useRef<boolean>(false);
@@ -326,9 +324,17 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
326
324
  values: []
327
325
  });
328
326
 
329
- function chkValueExist(v: any) {
327
+
328
+
329
+ // Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
330
+ const isSingleSpecialChar = (str: string) => {
331
+ return typeof str === 'string' && /^[^\w\s]$/.test(str);
332
+ };
333
+
334
+
335
+ const chkValueExist = (v: any) => {
330
336
  return typeof v !== 'undefined' && v !== '';
331
- }
337
+ };
332
338
 
333
339
 
334
340
  const listContainerHeightLimit = (num: number) => {
@@ -475,34 +481,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
475
481
  //performance
476
482
  const handleChangeFetchSafe = useDebounce((val: any) => {
477
483
 
478
- let _orginalData: OptionConfig[] = [];
479
- const update = (inputData: any) => {
480
- const filterRes = () => {
481
-
482
- return inputData.filter((item: any) => {
483
-
484
- // Avoid fatal errors causing page crashes
485
- const _queryString = typeof item.queryString !== 'undefined' && item.queryString !== null ? item.queryString : '';
486
- const _val = typeof val !== 'undefined' && val !== null ? val : '';
487
-
488
- if (
489
- (
490
- _queryString.split(',').some((l: any) => l.charAt(0) === _val.toLowerCase()) ||
491
- _queryString.split(',').some((l: any) => l.replace(/ /g, '').indexOf(_val.toLowerCase()) >= 0) ||
492
- item.label.toLowerCase().indexOf(_val.toLowerCase()) >= 0
493
- ) &&
494
- _val != ''
495
- ) {
496
- return true;
497
- } else {
498
- return false;
499
- }
500
- });
501
- }
502
-
503
- return filterRes();
504
- };
505
-
506
484
  if (fetchUpdate) {
507
485
 
508
486
  // update filter status
@@ -511,9 +489,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
511
489
 
512
490
  // Make a request
513
491
  handleFetch(val).then((response: any) => {
514
- _orginalData = response;
515
- const _filterRes = update(_orginalData);
516
-
492
+
517
493
  // pop win initalization
518
494
  setTimeout(() => {
519
495
  popwinPosInit();
@@ -521,9 +497,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
521
497
  }, 0);
522
498
  });
523
499
  } else {
524
- _orginalData = orginalData;
525
- const _filterRes = update(_orginalData);
526
-
500
+
527
501
  // pop win initalization
528
502
  setTimeout(() => {
529
503
  popwinPosInit();
@@ -1048,6 +1022,27 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1048
1022
  const _queryString = typeof node.dataset.querystring !== 'undefined' && node.dataset.querystring !== null ? node.dataset.querystring : '';
1049
1023
  const _val = typeof val !== 'undefined' && val !== null ? val : '';
1050
1024
 
1025
+
1026
+ // STEP 1
1027
+ //========
1028
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
1029
+ // If the condition is true, skip the loop and move on to the next node.
1030
+ if (fetchUpdate && _val == ' ') {
1031
+ return;
1032
+ }
1033
+
1034
+
1035
+ // STEP 2
1036
+ //========
1037
+ // @@@ This code is triggered only if a custom request is used to update "options" @@@
1038
+ // If the condition is true, skip the loop and move on to the next node.
1039
+ if (fetchUpdate && _val != '' && isSingleSpecialChar(_val)) {
1040
+ return;
1041
+ }
1042
+
1043
+
1044
+ // STEP 3
1045
+ //========
1051
1046
  if (
1052
1047
  (
1053
1048
  _queryString.split(',').some((l: any) => l.charAt(0) === _val.toLowerCase()) ||
@@ -1173,6 +1168,10 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1173
1168
  setFilterItemsHasNoMatchData(false);
1174
1169
 
1175
1170
 
1171
+ // reset Select All status (for "Single selection")
1172
+ setUserInputboxIsAllSelected(false);
1173
+
1174
+
1176
1175
  // Unlocks the page
1177
1176
  if (LOCK_BODY_SCROLL) enableBodyScroll(document.querySelector('body'));
1178
1177
  }
@@ -1271,7 +1270,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1271
1270
 
1272
1271
  if (typeof el === 'undefined') return;
1273
1272
 
1274
-
1275
1273
  const curItem: any = el === null ? (isObject(dataInput) ? dataInput : JSON.parse(dataInput)) : optionsData[Number(el.currentTarget.dataset.index)];
1276
1274
 
1277
1275
 
@@ -2207,6 +2205,16 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
2207
2205
  }, [orginalData]); // Avoid the issue that `setOptionsData(orginalData)` sets the original value to empty on the first entry
2208
2206
 
2209
2207
 
2208
+ // Select all detection functions in the input box (for "Single selection")
2209
+ function checkUserInputboxIsAllSelected(e: any) {
2210
+ const input = e.target;
2211
+ if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
2212
+ setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
2213
+ } else {
2214
+ setUserInputboxIsAllSelected(false);
2215
+ }
2216
+ }
2217
+
2210
2218
 
2211
2219
  return (
2212
2220
  <>
@@ -2316,6 +2324,11 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
2316
2324
  autoCapitalize={typeof autoCapitalize === 'undefined' ? 'off' : autoCapitalize}
2317
2325
  spellCheck={typeof spellCheck === 'undefined' ? false : spellCheck}
2318
2326
  {...attributes}
2327
+
2328
+ // Select all detection (for "Single selection")
2329
+ onSelect={(e) => { checkUserInputboxIsAllSelected(e); }}
2330
+ onKeyUp={(e) => { checkUserInputboxIsAllSelected(e); }}
2331
+ onMouseUp={(e) => { checkUserInputboxIsAllSelected(e); }}
2319
2332
  />
2320
2333
 
2321
2334
  </div>
@@ -2377,7 +2390,10 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
2377
2390
  <span ref={blinkingCursorPosDivRef} className={combinedCls(
2378
2391
  'custom-select-multi__control-blinking-cursor',
2379
2392
  {
2380
- 'animated': generateInputFocusStr() === BLINKING_CURSOR_STR
2393
+ 'animated': generateInputFocusStr() === BLINKING_CURSOR_STR,
2394
+
2395
+ // Select all highlights (for "Single selection")
2396
+ 'selected': userInputboxIsAllSelected
2381
2397
  }
2382
2398
  )}>
2383
2399
  {controlTempValue || controlTempValue === '' ? (controlTempValue.length === 0 ? <span className={`${!hideBlinkingCursor() ? 'control-placeholder' : ''}`}>{generateInputFocusStr()}</span> : <span>{controlTempValue}</span>) : (stripTagsAndContent(controlLabel as never).length === 0 ? <span className={`${!hideBlinkingCursor() ? 'control-placeholder' : ''}`}>{generateInputFocusStr()}</span> : <span>{stripTagsAndContent(controlLabel as never)}</span>)}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "UIUX Lab",
3
3
  "email": "uiuxlab@gmail.com",
4
4
  "name": "funda-ui",
5
- "version": "4.7.275",
5
+ "version": "4.7.333",
6
6
  "description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
7
7
  "repository": {
8
8
  "type": "git",