funda-ui 4.5.621 → 4.5.635

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
@@ -4168,6 +4168,17 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4168
4168
  }
4169
4169
  }, 0);
4170
4170
  }
4171
+ function syncListContentScrollBody() {
4172
+ var el = listContentRef.current;
4173
+ if (el === null) return;
4174
+ var activedItem = el.querySelectorAll(".list-group-item.".concat(!MULTI_SEL_VALID ? 'active' : 'item-selected'))[0];
4175
+ if (typeof activedItem !== 'undefined') {
4176
+ 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'));
4177
+ var cleanItemHeight = cleanItem === null ? 0 : cleanItem.clientHeight;
4178
+ var _latestScrollTop = activedItem.offsetTop - cleanItemHeight;
4179
+ el.scrollTop = _latestScrollTop;
4180
+ }
4181
+ }
4171
4182
  function popwinPosInit() {
4172
4183
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
4173
4184
  var contentHeightOffset = 80;
@@ -4304,6 +4315,11 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4304
4315
  //-----------
4305
4316
  // no data label
4306
4317
  popwinNoMatchInit();
4318
+
4319
+ // STEP 7:
4320
+ //-----------
4321
+ // Scrollbar position synchronization
4322
+ syncListContentScrollBody();
4307
4323
  }
4308
4324
  function popwinPosHide() {
4309
4325
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
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',
@@ -4168,6 +4168,17 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4168
4168
  }
4169
4169
  }, 0);
4170
4170
  }
4171
+ function syncListContentScrollBody() {
4172
+ var el = listContentRef.current;
4173
+ if (el === null) return;
4174
+ var activedItem = el.querySelectorAll(".list-group-item.".concat(!MULTI_SEL_VALID ? 'active' : 'item-selected'))[0];
4175
+ if (typeof activedItem !== 'undefined') {
4176
+ 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'));
4177
+ var cleanItemHeight = cleanItem === null ? 0 : cleanItem.clientHeight;
4178
+ var _latestScrollTop = activedItem.offsetTop - cleanItemHeight;
4179
+ el.scrollTop = _latestScrollTop;
4180
+ }
4181
+ }
4171
4182
  function popwinPosInit() {
4172
4183
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
4173
4184
  var contentHeightOffset = 80;
@@ -4304,6 +4315,11 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4304
4315
  //-----------
4305
4316
  // no data label
4306
4317
  popwinNoMatchInit();
4318
+
4319
+ // STEP 7:
4320
+ //-----------
4321
+ // Scrollbar position synchronization
4322
+ syncListContentScrollBody();
4307
4323
  }
4308
4324
  function popwinPosHide() {
4309
4325
  var _modalRef = document.querySelector("#custom-select__options-wrapper-".concat(idRes));
@@ -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',
@@ -49,8 +49,6 @@ import {
49
49
  import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
50
50
 
51
51
 
52
-
53
-
54
52
  export type SelectOptionChangeFnType = (arg1: any, arg2: any, arg3: any) => void;
55
53
 
56
54
  export interface MultiSelectDataConfig {
@@ -285,7 +283,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
285
283
  values: []
286
284
  });
287
285
 
288
-
289
286
  const listContainerHeightLimit = (num: number) => {
290
287
  let res = num;
291
288
  if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
@@ -675,6 +672,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
675
672
  onFetch?.(selectInputRef.current, valueInputRef.current, defaultValue, _ORGIN_DATA, incomingData);
676
673
 
677
674
 
675
+
678
676
  //
679
677
  return _ORGIN_DATA;
680
678
 
@@ -847,6 +845,22 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
847
845
  }
848
846
 
849
847
 
848
+ function syncListContentScrollBody() {
849
+ const el: any = listContentRef.current;
850
+ if (el === null) return;
851
+
852
+ const activedItem = el.querySelectorAll(`.list-group-item.${!MULTI_SEL_VALID ? 'active' : 'item-selected'}`)[0];
853
+ if (typeof activedItem !== 'undefined') {
854
+
855
+ 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'}`);
856
+ const cleanItemHeight = cleanItem === null ? 0 : cleanItem.clientHeight;
857
+ const _latestScrollTop = activedItem.offsetTop - cleanItemHeight;
858
+
859
+ el.scrollTop = _latestScrollTop;
860
+ }
861
+
862
+ }
863
+
850
864
 
851
865
  function popwinPosInit() {
852
866
  if (listContentRef.current === null || rootRef.current === null || selectInputRef.current === null) return;
@@ -915,6 +929,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
915
929
 
916
930
  // has scrollbar
917
931
  listContentRef.current.dataset.hasScrollbar = 'true';
932
+
918
933
 
919
934
  } else {
920
935
  if (_contentOldHeight > 50) {
@@ -1017,6 +1032,13 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1017
1032
  popwinNoMatchInit();
1018
1033
 
1019
1034
 
1035
+
1036
+ // STEP 7:
1037
+ //-----------
1038
+ // Scrollbar position synchronization
1039
+ syncListContentScrollBody();
1040
+
1041
+
1020
1042
  }
1021
1043
 
1022
1044
 
@@ -1209,8 +1231,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1209
1231
  // show list
1210
1232
  setIsOpen(true);
1211
1233
 
1212
-
1213
-
1214
1234
  // pop win initalization
1215
1235
  setTimeout(() => {
1216
1236
  popwinPosInit();
@@ -1226,7 +1246,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1226
1246
  }
1227
1247
 
1228
1248
 
1229
-
1230
1249
  if (MANUAL_REQ) {
1231
1250
  // clean data
1232
1251
  setOptionsData([]);
@@ -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.635",
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",