funda-ui 4.5.621 → 4.5.657

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Date/index.js CHANGED
@@ -1967,6 +1967,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1967
1967
  }, attributes)), appendControl || '', aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1968
1968
  ref: aiInputRef,
1969
1969
  className: "position-absolute z-1",
1970
+ "data-ai": "predict",
1970
1971
  style: {
1971
1972
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1972
1973
  top: originInputComputedStyle.current.textTop + 'px',
package/Input/index.js CHANGED
@@ -1413,6 +1413,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1413
1413
  }, attributes)), appendControl || '', aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1414
1414
  ref: aiInputRef,
1415
1415
  className: "position-absolute z-1",
1416
+ "data-ai": "predict",
1416
1417
  style: {
1417
1418
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1418
1419
  top: originInputComputedStyle.current.textTop + 'px',
@@ -1933,6 +1933,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1933
1933
  }, attributes)), appendControl || '', aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1934
1934
  ref: aiInputRef,
1935
1935
  className: "position-absolute z-1",
1936
+ "data-ai": "predict",
1936
1937
  style: {
1937
1938
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1938
1939
  top: originInputComputedStyle.current.textTop + 'px',
package/Select/index.js CHANGED
@@ -4155,6 +4155,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4155
4155
  return _fetchData.apply(this, arguments);
4156
4156
  }
4157
4157
  function adjustMultiControlContainerHeight() {
4158
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4158
4159
  setTimeout(function () {
4159
4160
  // Sometimes you may get 0, you need to judge
4160
4161
  if (MULTI_SEL_VALID && rootMultiRef.current.clientHeight > 0) {
@@ -4164,11 +4165,23 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4164
4165
  // popwin position update
4165
4166
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
4166
4167
  if (MULTI_SEL_VALID && _modalRef !== null && _modalRef.classList.contains('active')) {
4167
- popwinPosInit();
4168
+ popwinPosInit(scrollbarInit);
4168
4169
  }
4169
4170
  }, 0);
4170
4171
  }
4172
+ function syncListContentScrollBody() {
4173
+ var el = listContentRef.current;
4174
+ if (el === null) return;
4175
+ var activedItem = el.querySelectorAll(".list-group-item.".concat(!MULTI_SEL_VALID ? 'active' : 'item-selected'))[0];
4176
+ if (typeof activedItem !== 'undefined') {
4177
+ var cleanItem = el.querySelector(".list-group-item.".concat(!MULTI_SEL_VALID ? 'custom-select-multi__control-option-item--clean' : 'custom-select-multi__control-option-item--select-all'));
4178
+ var cleanItemHeight = cleanItem === null ? 0 : cleanItem.clientHeight;
4179
+ var _latestScrollTop = activedItem.offsetTop - cleanItemHeight;
4180
+ el.scrollTop = _latestScrollTop;
4181
+ }
4182
+ }
4171
4183
  function popwinPosInit() {
4184
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4172
4185
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
4173
4186
  var contentHeightOffset = 80;
4174
4187
  var contentMaxHeight = 0;
@@ -4304,6 +4317,11 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4304
4317
  //-----------
4305
4318
  // no data label
4306
4319
  popwinNoMatchInit();
4320
+
4321
+ // STEP 7:
4322
+ //-----------
4323
+ // Scrollbar position synchronization
4324
+ if (scrollbarInit) syncListContentScrollBody();
4307
4325
  }
4308
4326
  function popwinPosHide() {
4309
4327
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
@@ -4639,7 +4657,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4639
4657
  }
4640
4658
 
4641
4659
  // Appropriate multi-item container height
4642
- adjustMultiControlContainerHeight();
4660
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4661
+ adjustMultiControlContainerHeight(false);
4643
4662
 
4644
4663
  // active current option
4645
4664
  if (noCallback) {
@@ -4745,7 +4764,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4745
4764
  }
4746
4765
 
4747
4766
  // Appropriate multi-item container height
4748
- adjustMultiControlContainerHeight();
4767
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4768
+ adjustMultiControlContainerHeight(false);
4749
4769
 
4750
4770
  // active current option
4751
4771
  if (noCallback) {
package/Textarea/index.js CHANGED
@@ -1702,6 +1702,7 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1702
1702
  }, attributes)), aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1703
1703
  ref: aiInputRef,
1704
1704
  className: "position-absolute z-1",
1705
+ "data-ai": "predict",
1705
1706
  style: {
1706
1707
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1707
1708
  top: originInputComputedStyle.current.textTop + 'px',
@@ -1967,6 +1967,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1967
1967
  }, attributes)), appendControl || '', aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1968
1968
  ref: aiInputRef,
1969
1969
  className: "position-absolute z-1",
1970
+ "data-ai": "predict",
1970
1971
  style: {
1971
1972
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1972
1973
  top: originInputComputedStyle.current.textTop + 'px',
@@ -1413,6 +1413,7 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1413
1413
  }, attributes)), appendControl || '', aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1414
1414
  ref: aiInputRef,
1415
1415
  className: "position-absolute z-1",
1416
+ "data-ai": "predict",
1416
1417
  style: {
1417
1418
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1418
1419
  top: originInputComputedStyle.current.textTop + 'px',
@@ -1933,6 +1933,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1933
1933
  }, attributes)), appendControl || '', aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1934
1934
  ref: aiInputRef,
1935
1935
  className: "position-absolute z-1",
1936
+ "data-ai": "predict",
1936
1937
  style: {
1937
1938
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1938
1939
  top: originInputComputedStyle.current.textTop + 'px',
@@ -4155,6 +4155,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4155
4155
  return _fetchData.apply(this, arguments);
4156
4156
  }
4157
4157
  function adjustMultiControlContainerHeight() {
4158
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4158
4159
  setTimeout(function () {
4159
4160
  // Sometimes you may get 0, you need to judge
4160
4161
  if (MULTI_SEL_VALID && rootMultiRef.current.clientHeight > 0) {
@@ -4164,11 +4165,23 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4164
4165
  // popwin position update
4165
4166
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
4166
4167
  if (MULTI_SEL_VALID && _modalRef !== null && _modalRef.classList.contains('active')) {
4167
- popwinPosInit();
4168
+ popwinPosInit(scrollbarInit);
4168
4169
  }
4169
4170
  }, 0);
4170
4171
  }
4172
+ function syncListContentScrollBody() {
4173
+ var el = listContentRef.current;
4174
+ if (el === null) return;
4175
+ var activedItem = el.querySelectorAll(".list-group-item.".concat(!MULTI_SEL_VALID ? 'active' : 'item-selected'))[0];
4176
+ if (typeof activedItem !== 'undefined') {
4177
+ var cleanItem = el.querySelector(".list-group-item.".concat(!MULTI_SEL_VALID ? 'custom-select-multi__control-option-item--clean' : 'custom-select-multi__control-option-item--select-all'));
4178
+ var cleanItemHeight = cleanItem === null ? 0 : cleanItem.clientHeight;
4179
+ var _latestScrollTop = activedItem.offsetTop - cleanItemHeight;
4180
+ el.scrollTop = _latestScrollTop;
4181
+ }
4182
+ }
4171
4183
  function popwinPosInit() {
4184
+ var scrollbarInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4172
4185
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
4173
4186
  var contentHeightOffset = 80;
4174
4187
  var contentMaxHeight = 0;
@@ -4304,6 +4317,11 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4304
4317
  //-----------
4305
4318
  // no data label
4306
4319
  popwinNoMatchInit();
4320
+
4321
+ // STEP 7:
4322
+ //-----------
4323
+ // Scrollbar position synchronization
4324
+ if (scrollbarInit) syncListContentScrollBody();
4307
4325
  }
4308
4326
  function popwinPosHide() {
4309
4327
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
@@ -4639,7 +4657,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4639
4657
  }
4640
4658
 
4641
4659
  // Appropriate multi-item container height
4642
- adjustMultiControlContainerHeight();
4660
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4661
+ adjustMultiControlContainerHeight(false);
4643
4662
 
4644
4663
  // active current option
4645
4664
  if (noCallback) {
@@ -4745,7 +4764,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4745
4764
  }
4746
4765
 
4747
4766
  // Appropriate multi-item container height
4748
- adjustMultiControlContainerHeight();
4767
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
4768
+ adjustMultiControlContainerHeight(false);
4749
4769
 
4750
4770
  // active current option
4751
4771
  if (noCallback) {
@@ -1702,6 +1702,7 @@ var Textarea = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(fu
1702
1702
  }, attributes)), aiPredict && remainingText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1703
1703
  ref: aiInputRef,
1704
1704
  className: "position-absolute z-1",
1705
+ "data-ai": "predict",
1705
1706
  style: {
1706
1707
  left: "".concat(originInputComputedStyle.current.fontSize + textWidth, "px"),
1707
1708
  top: originInputComputedStyle.current.textTop + 'px',
@@ -561,6 +561,7 @@ const Input = forwardRef((props: InputProps, externalRef: any) => {
561
561
  <div
562
562
  ref={aiInputRef}
563
563
  className="position-absolute z-1"
564
+ data-ai="predict"
564
565
  style={{
565
566
  left: `${originInputComputedStyle.current.fontSize + textWidth}px`,
566
567
  top: originInputComputedStyle.current.textTop + 'px',
@@ -285,7 +285,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
285
285
  values: []
286
286
  });
287
287
 
288
-
289
288
  const listContainerHeightLimit = (num: number) => {
290
289
  let res = num;
291
290
  if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
@@ -675,6 +674,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
675
674
  onFetch?.(selectInputRef.current, valueInputRef.current, defaultValue, _ORGIN_DATA, incomingData);
676
675
 
677
676
 
677
+
678
678
  //
679
679
  return _ORGIN_DATA;
680
680
 
@@ -827,7 +827,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
827
827
  }
828
828
 
829
829
 
830
- function adjustMultiControlContainerHeight() {
830
+ function adjustMultiControlContainerHeight(scrollbarInit: boolean = true) {
831
831
  setTimeout(() => {
832
832
 
833
833
 
@@ -839,7 +839,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
839
839
  // popwin position update
840
840
  const _modalRef: any = document.querySelector(`#custom-select__options-wrapper-${idRes}`);
841
841
  if (MULTI_SEL_VALID && _modalRef !== null && _modalRef.classList.contains('active')) {
842
- popwinPosInit();
842
+ popwinPosInit(scrollbarInit);
843
843
  }
844
844
 
845
845
 
@@ -847,8 +847,24 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
847
847
  }
848
848
 
849
849
 
850
+ function syncListContentScrollBody() {
851
+ const el: any = listContentRef.current;
852
+ if (el === null) return;
853
+
854
+ const activedItem = el.querySelectorAll(`.list-group-item.${!MULTI_SEL_VALID ? 'active' : 'item-selected'}`)[0];
855
+ if (typeof activedItem !== 'undefined') {
856
+
857
+ const cleanItem = el.querySelector(`.list-group-item.${!MULTI_SEL_VALID ? 'custom-select-multi__control-option-item--clean' : 'custom-select-multi__control-option-item--select-all'}`);
858
+ const cleanItemHeight = cleanItem === null ? 0 : cleanItem.clientHeight;
859
+ const _latestScrollTop = activedItem.offsetTop - cleanItemHeight;
860
+
861
+ el.scrollTop = _latestScrollTop;
862
+ }
863
+
864
+ }
865
+
850
866
 
851
- function popwinPosInit() {
867
+ function popwinPosInit(scrollbarInit: boolean = true) {
852
868
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
853
869
 
854
870
  const contentHeightOffset = 80;
@@ -915,6 +931,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
915
931
 
916
932
  // has scrollbar
917
933
  listContentRef.current.dataset.hasScrollbar = 'true';
934
+
918
935
 
919
936
  } else {
920
937
  if (_contentOldHeight > 50) {
@@ -1017,6 +1034,14 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1017
1034
  popwinNoMatchInit();
1018
1035
 
1019
1036
 
1037
+
1038
+ // STEP 7:
1039
+ //-----------
1040
+ // Scrollbar position synchronization
1041
+ if (scrollbarInit) syncListContentScrollBody();
1042
+
1043
+
1044
+
1020
1045
  }
1021
1046
 
1022
1047
 
@@ -1209,8 +1234,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1209
1234
  // show list
1210
1235
  setIsOpen(true);
1211
1236
 
1212
-
1213
-
1214
1237
  // pop win initalization
1215
1238
  setTimeout(() => {
1216
1239
  popwinPosInit();
@@ -1226,7 +1249,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1226
1249
  }
1227
1250
 
1228
1251
 
1229
-
1230
1252
  if (MANUAL_REQ) {
1231
1253
  // clean data
1232
1254
  setOptionsData([]);
@@ -1416,7 +1438,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1416
1438
  }
1417
1439
 
1418
1440
  // Appropriate multi-item container height
1419
- adjustMultiControlContainerHeight();
1441
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
1442
+ adjustMultiControlContainerHeight(false);
1420
1443
 
1421
1444
 
1422
1445
  // active current option
@@ -1567,7 +1590,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1567
1590
 
1568
1591
 
1569
1592
  // Appropriate multi-item container height
1570
- adjustMultiControlContainerHeight();
1593
+ // !!!set `false` to prevents the scrollbar position from changing when multi-selecting the option is clicked
1594
+ adjustMultiControlContainerHeight(false);
1571
1595
 
1572
1596
  // active current option
1573
1597
  if (noCallback) {
@@ -548,6 +548,7 @@ const Textarea = forwardRef((props: TextareaProps, externalRef: any) => {
548
548
  <div
549
549
  ref={aiInputRef}
550
550
  className="position-absolute z-1"
551
+ data-ai="predict"
551
552
  style={{
552
553
  left: `${originInputComputedStyle.current.fontSize + textWidth}px`,
553
554
  top: originInputComputedStyle.current.textTop + 'px',
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.5.621",
5
+ "version": "4.5.657",
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",