funda-ui 4.7.152 → 4.7.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CascadingSelect/index.js +13 -6
  2. package/CascadingSelectE2E/index.js +13 -6
  3. package/Chatbox/index.css +8 -0
  4. package/Chatbox/index.d.ts +1 -0
  5. package/Chatbox/index.js +18 -8
  6. package/Date/index.js +13 -6
  7. package/DropdownMenu/index.js +13 -6
  8. package/EventCalendar/index.js +42 -35
  9. package/EventCalendarTimeline/index.js +55 -41
  10. package/LiveSearch/index.css +33 -0
  11. package/LiveSearch/index.d.ts +1 -0
  12. package/LiveSearch/index.js +186 -91
  13. package/ModalDialog/index.js +13 -6
  14. package/RootPortal/index.d.ts +2 -1
  15. package/RootPortal/index.js +13 -6
  16. package/Select/index.js +81 -72
  17. package/Toast/index.js +13 -6
  18. package/Tooltip/index.js +13 -6
  19. package/lib/cjs/CascadingSelect/index.js +13 -6
  20. package/lib/cjs/CascadingSelectE2E/index.js +13 -6
  21. package/lib/cjs/Chatbox/index.d.ts +1 -0
  22. package/lib/cjs/Chatbox/index.js +18 -8
  23. package/lib/cjs/Date/index.js +13 -6
  24. package/lib/cjs/DropdownMenu/index.js +13 -6
  25. package/lib/cjs/EventCalendar/index.js +42 -35
  26. package/lib/cjs/EventCalendarTimeline/index.js +55 -41
  27. package/lib/cjs/LiveSearch/index.d.ts +1 -0
  28. package/lib/cjs/LiveSearch/index.js +186 -91
  29. package/lib/cjs/ModalDialog/index.js +13 -6
  30. package/lib/cjs/RootPortal/index.d.ts +2 -1
  31. package/lib/cjs/RootPortal/index.js +13 -6
  32. package/lib/cjs/Select/index.js +81 -72
  33. package/lib/cjs/Toast/index.js +13 -6
  34. package/lib/cjs/Tooltip/index.js +13 -6
  35. package/lib/css/Chatbox/index.css +8 -0
  36. package/lib/css/LiveSearch/index.css +33 -0
  37. package/lib/esm/Chatbox/index.scss +9 -0
  38. package/lib/esm/Chatbox/index.tsx +7 -4
  39. package/lib/esm/LiveSearch/index.scss +47 -0
  40. package/lib/esm/LiveSearch/index.tsx +120 -64
  41. package/lib/esm/RootPortal/index.tsx +14 -8
  42. package/lib/esm/SearchBar/index.tsx +1 -0
  43. package/lib/esm/Select/index.tsx +65 -64
  44. package/lib/esm/Textarea/index.tsx +1 -0
  45. package/package.json +1 -1
@@ -171,7 +171,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
171
171
  var RootPortal = function RootPortal(props) {
172
172
  var containerClassName = props.containerClassName,
173
173
  show = props.show,
174
- children = props.children;
174
+ children = props.children,
175
+ _props$usePortal = props.usePortal,
176
+ usePortal = _props$usePortal === void 0 ? true : _props$usePortal;
175
177
  var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
176
178
 
177
179
  // Move HTML templates to tag end body </body>
@@ -182,15 +184,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
182
184
  // Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined
183
185
 
184
186
  (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
185
- containerRef.current = document.createElement('div');
186
- containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
187
- document.body.appendChild(containerRef.current);
187
+ if (usePortal) {
188
+ containerRef.current = document.createElement('div');
189
+ containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
190
+ document.body.appendChild(containerRef.current);
191
+ }
188
192
  return function () {
189
- if (containerRef.current) {
193
+ if (usePortal && containerRef.current) {
190
194
  containerRef.current.remove();
191
195
  }
192
196
  };
193
- }, []);
197
+ }, [usePortal]);
198
+ if (!usePortal) {
199
+ return show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, children) : null;
200
+ }
194
201
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, containerRef.current && show && /*#__PURE__*/(0, react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, containerRef.current));
195
202
  };
196
203
  /* harmony default export */
@@ -3778,7 +3785,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3778
3785
  firstRequestAutoExec = props.firstRequestAutoExec,
3779
3786
  fetchTrigger = props.fetchTrigger,
3780
3787
  fetchTriggerForDefaultData = props.fetchTriggerForDefaultData,
3781
- fetchNoneInfo = props.fetchNoneInfo,
3788
+ _props$fetchNoneInfo = props.fetchNoneInfo,
3789
+ fetchNoneInfo = _props$fetchNoneInfo === void 0 ? 'No match yet' : _props$fetchNoneInfo,
3782
3790
  fetchUpdate = props.fetchUpdate,
3783
3791
  fetchFuncAsync = props.fetchFuncAsync,
3784
3792
  fetchFuncMethod = props.fetchFuncMethod,
@@ -3851,7 +3859,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3851
3859
  var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
3852
3860
  _useState12 = _slicedToArray(_useState11, 2),
3853
3861
  controlTempValue = _useState12[0],
3854
- setControlTempValue = _useState12[1];
3862
+ setControlTempValue = _useState12[1]; // Storage for temporary input
3855
3863
  var _useState13 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3856
3864
  _useState14 = _slicedToArray(_useState13, 2),
3857
3865
  isOpen = _useState14[0],
@@ -3869,6 +3877,11 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3869
3877
  handleFirstFetchCompleted = _useState20[0],
3870
3878
  setHandleFirstFetchCompleted = _useState20[1];
3871
3879
 
3880
+ // Mark whether it is out of focus
3881
+ // Fixed the issue that caused the pop-up window to still display due to
3882
+ // the delayed close in handleBlur and the timing of the call to popwinPosInit
3883
+ var isBlurringRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
3884
+
3872
3885
  // filter status
3873
3886
  var _useState21 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
3874
3887
  _useState22 = _slicedToArray(_useState21, 2),
@@ -4090,7 +4103,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4090
4103
  function _fetchData() {
4091
4104
  _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, valueToInputDefault, inputDefault) {
4092
4105
  var init,
4093
- incomingOptionsData,
4094
4106
  defaultValue,
4095
4107
  response,
4096
4108
  _ORGIN_DATA,
@@ -4109,17 +4121,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4109
4121
  while (1) switch (_context.prev = _context.next) {
4110
4122
  case 0:
4111
4123
  init = _args.length > 3 && _args[3] !== undefined ? _args[3] : true;
4112
- // get incoming options from `data-options` of component
4113
- // It is usually used for complex cascading `<Select />` components
4114
- incomingOptionsData = valueInputRef.current.dataset.options; // Determine whether the default value is user query input or default input
4124
+ // Determine whether the default value is user query input or default input
4115
4125
  defaultValue = init ? valueToInputDefault : '';
4116
4126
  if (!(_typeof(fetchFuncAsync) === 'object')) {
4117
- _context.next = 25;
4127
+ _context.next = 23;
4118
4128
  break;
4119
4129
  }
4120
- _context.next = 6;
4130
+ _context.next = 5;
4121
4131
  return fetchFuncAsync["".concat(fetchFuncMethod)].apply(fetchFuncAsync, _toConsumableArray(params.split(',')));
4122
- case 6:
4132
+ case 5:
4123
4133
  response = _context.sent;
4124
4134
  _ORGIN_DATA = response.data; // reset data structure
4125
4135
  if (typeof fetchCallback === 'function') {
@@ -4134,26 +4144,17 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4134
4144
  }
4135
4145
 
4136
4146
  // STEP 1: ===========
4137
- // get incoming options from `data-options` of component
4138
- if (typeof incomingOptionsData !== 'undefined') {
4139
- _ORGIN_DATA = JSON.parse(incomingOptionsData);
4140
-
4141
- // set value if the attribute `data-options` of component exists, only valid for single selection (it may be an empty array)
4142
- if (typeof defaultValue !== 'undefined' && defaultValue !== '') valueInputRef.current.dataset.value = defaultValue;
4143
- }
4144
-
4145
- // STEP 2: ===========
4146
4147
  // Set hierarchical categories ( with sub-categories )
4147
4148
  if (hierarchical) {
4148
4149
  _ORGIN_DATA = (0,tree.addTreeDepth)(_ORGIN_DATA);
4149
4150
  (0,tree.addTreeIndent)(_ORGIN_DATA, INDENT_PLACEHOLDER, INDENT_LAST_PLACEHOLDER, 'label');
4150
4151
  }
4151
4152
 
4152
- // STEP 3: ===========
4153
+ // STEP 2: ===========
4153
4154
  // Flatten the group
4154
4155
  _ORGIN_DATA = optionsCustomSelectFlat(_ORGIN_DATA);
4155
4156
 
4156
- // STEP 4: ===========
4157
+ // STEP 3: ===========
4157
4158
  // value & label must be initialized
4158
4159
  filterRes = [];
4159
4160
  if (MANUAL_REQ) {
@@ -4182,7 +4183,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4182
4183
  }
4183
4184
  }
4184
4185
 
4185
- // STEP 5: ===========
4186
+ // STEP 4: ===========
4186
4187
  // ++++++++++++++++++++
4187
4188
  // Single selection
4188
4189
  // ++++++++++++++++++++
@@ -4250,7 +4251,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4250
4251
  });
4251
4252
  }
4252
4253
 
4253
- // STEP 6: ===========
4254
+ // STEP 5: ===========
4254
4255
  //
4255
4256
  // remove Duplicate objects from JSON Array
4256
4257
  optionsFormatGroupOpt(_ORGIN_DATA); // prevent the value from being filtered out
@@ -4260,34 +4261,25 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4260
4261
  //
4261
4262
  setOrginalData(_ORGIN_DATA);
4262
4263
 
4263
- // STEP 7: ===========
4264
+ // STEP 6: ===========
4264
4265
  //
4265
4266
  onFetch === null || onFetch === void 0 ? void 0 : onFetch(selectInputRef.current, valueInputRef.current, defaultValue, _ORGIN_DATA, incomingData);
4266
4267
 
4267
4268
  //
4268
4269
  return _context.abrupt("return", _ORGIN_DATA);
4269
- case 25:
4270
+ case 23:
4270
4271
  // STEP 1: ===========
4271
- // get incoming options from `data-options` of component
4272
- if (typeof incomingOptionsData !== 'undefined') {
4273
- staticOptionsData = JSON.parse(incomingOptionsData);
4274
-
4275
- // set value if the attribute `data-options` of component exists, only valid for single selection (it may be an empty array)
4276
- if (typeof defaultValue !== 'undefined' && defaultValue !== '') valueInputRef.current.dataset.value = defaultValue;
4277
- }
4278
-
4279
- // STEP 2: ===========
4280
4272
  // Set hierarchical categories ( with sub-categories )
4281
4273
  if (hierarchical) {
4282
4274
  staticOptionsData = (0,tree.addTreeDepth)(staticOptionsData);
4283
4275
  (0,tree.addTreeIndent)(staticOptionsData, INDENT_PLACEHOLDER, INDENT_LAST_PLACEHOLDER, 'label');
4284
4276
  }
4285
4277
 
4286
- // STEP 3: ===========
4278
+ // STEP 2: ===========
4287
4279
  // Flatten the group
4288
4280
  staticOptionsData = optionsCustomSelectFlat(staticOptionsData);
4289
4281
 
4290
- // STEP 4: ===========
4282
+ // STEP 3: ===========
4291
4283
  // value & label must be initialized
4292
4284
 
4293
4285
  // If the default value is label, match value
@@ -4306,7 +4298,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4306
4298
  _filterRes3 = [inputDefault];
4307
4299
  }
4308
4300
 
4309
- // STEP 5: ===========
4301
+ // STEP 4: ===========
4310
4302
  // ++++++++++++++++++++
4311
4303
  // Single selection
4312
4304
  // ++++++++++++++++++++
@@ -4374,7 +4366,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4374
4366
  });
4375
4367
  }
4376
4368
 
4377
- // STEP 6: ===========
4369
+ // STEP 5: ===========
4378
4370
  //
4379
4371
  // remove Duplicate objects from JSON Array
4380
4372
  optionsFormatGroupOpt(staticOptionsData); // prevent the value from being filtered out
@@ -4384,13 +4376,13 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4384
4376
  //
4385
4377
  setOrginalData(staticOptionsData);
4386
4378
 
4387
- // STEP 7: ===========
4379
+ // STEP 6: ===========
4388
4380
  //
4389
4381
  onFetch === null || onFetch === void 0 ? void 0 : onFetch(selectInputRef.current, valueInputRef.current, defaultValue, staticOptionsData, incomingData);
4390
4382
 
4391
4383
  //
4392
4384
  return _context.abrupt("return", staticOptionsData);
4393
- case 42:
4385
+ case 39:
4394
4386
  case "end":
4395
4387
  return _context.stop();
4396
4388
  }
@@ -4428,6 +4420,11 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4428
4420
  function popwinPosInit() {
4429
4421
  var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4430
4422
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
4423
+
4424
+ // If it is out of focus, do not perform position initialization
4425
+ if (isBlurringRef.current) return;
4426
+
4427
+ //
4431
4428
  var contentHeightOffset = 80;
4432
4429
  var contentMaxHeight = 0;
4433
4430
 
@@ -4593,7 +4590,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4593
4590
  }
4594
4591
  function popwinFilterItems(val) {
4595
4592
  if (listContentRef.current === null) return;
4596
- var invisibleItems = 0;
4597
4593
  [].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item')).forEach(function (node) {
4598
4594
  // Avoid fatal errors causing page crashes
4599
4595
  var _queryString = typeof node.dataset.querystring !== 'undefined' && node.dataset.querystring !== null ? node.dataset.querystring : '';
@@ -4750,6 +4746,13 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4750
4746
  selectInputRef.current.select();
4751
4747
  }
4752
4748
 
4749
+ // Every time the input changes or the search button is clicked, a data request will be triggered
4750
+ if (MANUAL_REQ && (controlTempValue === '' || controlTempValue === null)) {
4751
+ setTimeout(function () {
4752
+ popwinPosHide();
4753
+ }, 0);
4754
+ }
4755
+
4753
4756
  // update temporary value
4754
4757
  setControlTempValue('');
4755
4758
 
@@ -4773,7 +4776,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4773
4776
  valueArr,
4774
4777
  labelArr,
4775
4778
  curItem,
4776
- incominggetOptionsData,
4777
4779
  options,
4778
4780
  curBtn,
4779
4781
  noCallback,
@@ -4808,9 +4810,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4808
4810
  }
4809
4811
  return _context2.abrupt("return");
4810
4812
  case 5:
4811
- curItem = el === null ? isObject(dataInput) ? dataInput : JSON.parse(dataInput) : optionsData[Number(el.currentTarget.dataset.index)]; // get incoming options from `data-options` of component
4812
- // It is usually used for complex cascading `<Select />` components
4813
- incominggetOptionsData = valueInputRef.current.dataset.options; // get options
4813
+ curItem = el === null ? isObject(dataInput) ? dataInput : JSON.parse(dataInput) : optionsData[Number(el.currentTarget.dataset.index)]; // get options
4814
4814
  options = [].slice.call(listRef.current.querySelectorAll('.list-group-item:not(.hide):not(.no-match)')); // current control of some option
4815
4815
  curBtn = options.filter(function (node) {
4816
4816
  return node.dataset.itemdata == JSON.stringify(curItem);
@@ -4864,11 +4864,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4864
4864
  setControlValue(_value);
4865
4865
  setControlLabel(formatIndentVal(_label, INDENT_LAST_PLACEHOLDER));
4866
4866
 
4867
- // set value if the attribute `data-options` of component exists, only valid for single selection (it may be an empty array)
4868
- if (typeof incominggetOptionsData !== 'undefined') {
4869
- valueInputRef.current.dataset.value = _value;
4870
- }
4871
-
4872
4867
  // ++++++++++++++++++++
4873
4868
  // Multiple selection
4874
4869
  // ++++++++++++++++++++
@@ -4970,11 +4965,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4970
4965
  setControlValue(_value2);
4971
4966
  setControlLabel(formatIndentVal(_label2, INDENT_LAST_PLACEHOLDER));
4972
4967
 
4973
- // set value if the attribute `data-options` of component exists, only valid for single selection (it may be an empty array)
4974
- if (typeof incominggetOptionsData !== 'undefined') {
4975
- valueInputRef.current.dataset.value = _value2;
4976
- }
4977
-
4978
4968
  // ++++++++++++++++++++
4979
4969
  // Multiple selection
4980
4970
  // ++++++++++++++++++++
@@ -5048,7 +5038,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5048
5038
 
5049
5039
  // Fixed an out-of-focus issue
5050
5040
  fixFocusStatus();
5051
- case 13:
5041
+ case 12:
5052
5042
  case "end":
5053
5043
  return _context2.stop();
5054
5044
  }
@@ -5199,6 +5189,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5199
5189
  }
5200
5190
  }
5201
5191
  function handleShowList() {
5192
+ // Reset the out-of-focus marker
5193
+ isBlurringRef.current = false;
5194
+
5202
5195
  //
5203
5196
  if (!isOpen) {
5204
5197
  activate();
@@ -5255,18 +5248,25 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5255
5248
  while (1) switch (_context4.prev = _context4.next) {
5256
5249
  case 0:
5257
5250
  inputVal = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : null;
5251
+ if (!MANUAL_REQ) {
5252
+ _context4.next = 3;
5253
+ break;
5254
+ }
5255
+ return _context4.abrupt("return", []);
5256
+ case 3:
5257
+ //
5258
5258
  _oparams = fetchFuncMethodParams || [];
5259
5259
  _params = _oparams.map(function (item) {
5260
5260
  return item !== '$QUERY_STRING' ? item : MANUAL_REQ ? QUERY_STRING_PLACEHOLDER : '';
5261
5261
  });
5262
- _context4.next = 5;
5262
+ _context4.next = 7;
5263
5263
  return fetchData(_params.join(','), finalRes(inputVal), inputVal);
5264
- case 5:
5264
+ case 7:
5265
5265
  res = _context4.sent;
5266
5266
  // Set an identifier indicating that the first request has been completed
5267
5267
  if (!handleFirstFetchCompleted) setHandleFirstFetchCompleted(true);
5268
5268
  return _context4.abrupt("return", res);
5269
- case 8:
5269
+ case 10:
5270
5270
  case "end":
5271
5271
  return _context4.stop();
5272
5272
  }
@@ -5294,6 +5294,11 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5294
5294
 
5295
5295
  // Fixed an out-of-focus issue
5296
5296
  fixFocusStatus();
5297
+
5298
+ // Every time the input changes or the search button is clicked, a data request will be triggered
5299
+ if (MANUAL_REQ && val !== '') {
5300
+ popwinPosInit();
5301
+ }
5297
5302
  }
5298
5303
 
5299
5304
  //
@@ -5301,14 +5306,14 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5301
5306
  var _rootRef$current;
5302
5307
  (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
5303
5308
 
5304
- // update temporary value
5305
- setControlTempValue('');
5306
-
5307
5309
  //
5308
5310
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(selectInputRef.current);
5309
5311
  }
5310
5312
  function handleBlur(event) {
5311
5313
  var _rootRef$current2;
5314
+ // Set the out-of-focus marker
5315
+ isBlurringRef.current = true;
5316
+
5312
5317
  // Fix the focus issue with using the "Tabs" and "Enter" keys
5313
5318
  //
5314
5319
  //
@@ -5667,6 +5672,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5667
5672
  type: "button",
5668
5673
  className: "btn border-end-0 rounded-pill",
5669
5674
  onClick: function onClick(e) {
5675
+ e.preventDefault();
5676
+ e.stopPropagation();
5670
5677
  handleFetch().then(function (response) {
5671
5678
  // pop win initalization
5672
5679
  setTimeout(function () {
@@ -5693,10 +5700,10 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5693
5700
  pointerEvents: 'auto',
5694
5701
  cursor: 'pointer'
5695
5702
  } : undefined,
5696
- onClick: MULTI_SEL_ENTIRE_AREA_TRIGGER ? typeof readOnly === 'undefined' || !readOnly ? handleShowList : function () {
5697
- return void 0;
5698
- } : function () {
5699
- return void 0;
5703
+ onClick: function onClick(e) {
5704
+ if (MULTI_SEL_ENTIRE_AREA_TRIGGER) {
5705
+ if (typeof readOnly === 'undefined' || !readOnly) handleShowList();
5706
+ }
5700
5707
  }
5701
5708
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
5702
5709
  className: "custom-select-multi__list"
@@ -5790,6 +5797,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5790
5797
  type: "button",
5791
5798
  className: "btn border-end-0 rounded-pill",
5792
5799
  onClick: function onClick(e) {
5800
+ e.preventDefault();
5801
+ e.stopPropagation();
5793
5802
  handleFetch().then(function (response) {
5794
5803
  // pop win initalization
5795
5804
  setTimeout(function () {
@@ -5894,7 +5903,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
5894
5903
  }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
5895
5904
  fill: "inherit",
5896
5905
  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"
5897
- }))))) : /*#__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 || 'No match yet')), optionsData ? optionsData.map(function (item, index) {
5906
+ }))))) : /*#__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) {
5898
5907
  var startItemBorder = index === 0 ? 'border-top-0' : '';
5899
5908
  var endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
5900
5909
 
@@ -171,7 +171,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
171
171
  var RootPortal = function RootPortal(props) {
172
172
  var containerClassName = props.containerClassName,
173
173
  show = props.show,
174
- children = props.children;
174
+ children = props.children,
175
+ _props$usePortal = props.usePortal,
176
+ usePortal = _props$usePortal === void 0 ? true : _props$usePortal;
175
177
  var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
176
178
 
177
179
  // Move HTML templates to tag end body </body>
@@ -182,15 +184,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
182
184
  // Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined
183
185
 
184
186
  (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
185
- containerRef.current = document.createElement('div');
186
- containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
187
- document.body.appendChild(containerRef.current);
187
+ if (usePortal) {
188
+ containerRef.current = document.createElement('div');
189
+ containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
190
+ document.body.appendChild(containerRef.current);
191
+ }
188
192
  return function () {
189
- if (containerRef.current) {
193
+ if (usePortal && containerRef.current) {
190
194
  containerRef.current.remove();
191
195
  }
192
196
  };
193
- }, []);
197
+ }, [usePortal]);
198
+ if (!usePortal) {
199
+ return show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, children) : null;
200
+ }
194
201
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, containerRef.current && show && /*#__PURE__*/(0, react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, containerRef.current));
195
202
  };
196
203
  /* harmony default export */
@@ -171,7 +171,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
171
171
  var RootPortal = function RootPortal(props) {
172
172
  var containerClassName = props.containerClassName,
173
173
  show = props.show,
174
- children = props.children;
174
+ children = props.children,
175
+ _props$usePortal = props.usePortal,
176
+ usePortal = _props$usePortal === void 0 ? true : _props$usePortal;
175
177
  var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
176
178
 
177
179
  // Move HTML templates to tag end body </body>
@@ -182,15 +184,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
182
184
  // Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined
183
185
 
184
186
  (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
185
- containerRef.current = document.createElement('div');
186
- containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
187
- document.body.appendChild(containerRef.current);
187
+ if (usePortal) {
188
+ containerRef.current = document.createElement('div');
189
+ containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
190
+ document.body.appendChild(containerRef.current);
191
+ }
188
192
  return function () {
189
- if (containerRef.current) {
193
+ if (usePortal && containerRef.current) {
190
194
  containerRef.current.remove();
191
195
  }
192
196
  };
193
- }, []);
197
+ }, [usePortal]);
198
+ if (!usePortal) {
199
+ return show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, children) : null;
200
+ }
194
201
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, containerRef.current && show && /*#__PURE__*/(0, react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, containerRef.current));
195
202
  };
196
203
  /* harmony default export */
@@ -154,6 +154,7 @@
154
154
  right: 0;
155
155
  z-index: 1031;
156
156
  height: var(--custom-chatbox-h);
157
+ /* disable popup */
157
158
  /* message list */
158
159
  /* dot loading */
159
160
  /* control area */
@@ -164,6 +165,12 @@
164
165
  /* default questions */
165
166
  /* Tooltip */
166
167
  }
168
+ .custom-chatbox-container.popup-none {
169
+ position: relative;
170
+ bottom: auto;
171
+ right: auto;
172
+ box-shadow: none;
173
+ }
167
174
  .custom-chatbox-container details {
168
175
  font-style: italic;
169
176
  margin: 0;
@@ -375,6 +382,7 @@
375
382
  border: 1px solid var(--custom-chatbox-gray-color);
376
383
  border-radius: 0.35rem;
377
384
  transition: all 0.3s ease;
385
+ background: var(--custom-chatbox-input-bg);
378
386
  }
379
387
  .custom-chatbox-container .msgcontrol img, .custom-chatbox-container .msgcontrol svg, .custom-chatbox-container .msgcontrol video, .custom-chatbox-container .msgcontrol canvas, .custom-chatbox-container .msgcontrol audio, .custom-chatbox-container .msgcontrol iframe, .custom-chatbox-container .msgcontrol embed, .custom-chatbox-container .msgcontrol object {
380
388
  display: inline;
@@ -2,7 +2,9 @@
2
2
  <!-- Live Search -->
3
3
  /* ====================================================== */
4
4
  .livesearch__wrapper {
5
+ position: relative;
5
6
  /*------ Search button ------*/
7
+ /*------ Loader ------*/
6
8
  }
7
9
  .livesearch__wrapper .livesearch__wrapper-searchbtn {
8
10
  position: absolute;
@@ -12,6 +14,35 @@
12
14
  z-index: 5;
13
15
  pointer-events: auto;
14
16
  }
17
+ .livesearch__wrapper .livesearch-loader {
18
+ position: absolute;
19
+ right: 0;
20
+ top: 50%;
21
+ margin-top: -6px;
22
+ pointer-events: none;
23
+ pointer-events: none;
24
+ z-index: 5;
25
+ width: 12px;
26
+ height: 12px;
27
+ text-align: center;
28
+ transform-origin: center;
29
+ transform: translate(-5px, 0) rotate(0);
30
+ animation: 1s linear infinite livesearch__spinner;
31
+ }
32
+ .livesearch__wrapper .livesearch-loader.pos-offset {
33
+ right: 2rem;
34
+ }
35
+ .livesearch__wrapper .livesearch-loader svg {
36
+ vertical-align: top;
37
+ }
38
+ .livesearch__wrapper .livesearch-loader svg path {
39
+ fill: var(--cus-sel-loader-color);
40
+ }
41
+ @keyframes livesearch__spinner {
42
+ to {
43
+ transform: translate(-5px, 0) rotate(-360deg);
44
+ }
45
+ }
15
46
 
16
47
  /*------ List ------*/
17
48
  .livesearch__options-wrapper {
@@ -23,6 +54,7 @@
23
54
  display: none;
24
55
  min-width: var(--livesearch-listgroup-popwin-min-width);
25
56
  z-index: 1055; /* --bs-modal-zindex */
57
+ /*------ Options ------*/
26
58
  }
27
59
  .livesearch__options-wrapper.active {
28
60
  display: block !important;
@@ -30,6 +62,7 @@
30
62
  .livesearch__options-wrapper .livesearch__options-contentlist {
31
63
  overflow: hidden;
32
64
  overflow-y: auto;
65
+ background-color: var(--bs-list-group-bg);
33
66
  }
34
67
  .livesearch__options-wrapper .livesearch__options-contentlist.noscroll {
35
68
  overflow-y: hidden;
@@ -189,6 +189,14 @@
189
189
  z-index: 1031;
190
190
  height: var(--custom-chatbox-h);
191
191
 
192
+ /* disable popup */
193
+ &.popup-none {
194
+ position: relative;
195
+ bottom: auto;
196
+ right: auto;
197
+ box-shadow: none;
198
+ }
199
+
192
200
  details {
193
201
  font-style: italic;
194
202
  margin: 0;
@@ -449,6 +457,7 @@
449
457
  border: 1px solid var(--custom-chatbox-gray-color);
450
458
  border-radius: 0.35rem;
451
459
  transition: all 0.3s ease;
460
+ background: var(--custom-chatbox-input-bg);
452
461
 
453
462
  img, svg, video, canvas, audio, iframe, embed, object {
454
463
  display: inline;
@@ -12,7 +12,6 @@ import useClickOutside from 'funda-utils/dist/cjs/useClickOutside';
12
12
  import { htmlEncode } from 'funda-utils/dist/cjs/sanitize';
13
13
 
14
14
 
15
-
16
15
  // loader
17
16
  import PureLoader from './PureLoader';
18
17
  import TypingEffect from "./TypingEffect";
@@ -129,6 +128,7 @@ export type ChatboxProps = {
129
128
  defaultQuestions?: QuestionData;
130
129
  showCopyBtn?: boolean; // Whether to show copy button for each reply
131
130
  autoCopyReply?: boolean; // Whether to automatically copy reply to clipboard
131
+ usePopUp?: boolean;
132
132
  customRequest?: CustomRequestFunction;
133
133
  renderParser?: (input: string) => Promise<string>;
134
134
  requestBodyFormatter?: (body: any, contextData: Record<string, any>, conversationHistory: MessageDetail[]) => Promise<Record<string, any>>;
@@ -319,6 +319,7 @@ const Chatbox = (props: ChatboxProps) => {
319
319
  toolkitButtons,
320
320
  newChatButton,
321
321
  maxHistoryLength,
322
+ usePopUp,
322
323
  customRequest,
323
324
  onQuestionClick,
324
325
  onCopyCallback,
@@ -399,6 +400,7 @@ const Chatbox = (props: ChatboxProps) => {
399
400
  maxHistoryLength,
400
401
  toolkitButtons,
401
402
  newChatButton,
403
+ usePopUp,
402
404
  customRequest,
403
405
  onQuestionClick,
404
406
  onCopyCallback,
@@ -1330,7 +1332,7 @@ const Chatbox = (props: ChatboxProps) => {
1330
1332
  return (
1331
1333
  <>
1332
1334
 
1333
- <RootPortal show={true} containerClassName="Chatbox">
1335
+ <RootPortal show={true} usePortal={args().usePopUp} containerClassName="Chatbox">
1334
1336
 
1335
1337
  {/**------------- BUBBLE -------------*/}
1336
1338
  {args().bubble ? <>
@@ -1353,7 +1355,7 @@ const Chatbox = (props: ChatboxProps) => {
1353
1355
  {/**------------- CLOSE BUTTON------------- */}
1354
1356
 
1355
1357
 
1356
- <div style={{ display: show ? 'block' : 'none' }} className={`${args().prefix || 'custom-'}chatbox-container`} ref={rootRef}>
1358
+ <div style={{ display: show ? 'block' : 'none' }} className={`${args().prefix || 'custom-'}chatbox-container ${typeof args().usePopUp !== 'undefined' && args().usePopUp === false ? 'popup-none' : ''}`} ref={rootRef}>
1357
1359
 
1358
1360
  {/**------------- NO DATA -------------*/}
1359
1361
  {msgList.length === 0 ? <>
@@ -1393,7 +1395,8 @@ const Chatbox = (props: ChatboxProps) => {
1393
1395
 
1394
1396
 
1395
1397
  {/**------------- MESSAGES LIST -------------*/}
1396
- <div className="messages" ref={msgContainerRef}>
1398
+ {/** Prevent excessive height overflow */}
1399
+ <div className={`messages ${msgList.length === 0 ? 'd-none' : ''}`} ref={msgContainerRef}>
1397
1400
 
1398
1401
  {msgList.map((msg, index) => {
1399
1402