funda-ui 4.5.512 → 4.5.522

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.
@@ -19,7 +19,7 @@
19
19
  --livesearch-listgroup-item-hover-focus-bg: rgba(0,0,0,.1);
20
20
  --livesearch-listgroup-content-scrollbar-color: rgba(0, 0, 0, 0.2);
21
21
  --livesearch-listgroup-content-scrollbar-track: rgba(0, 0, 0, 0);
22
- --livesearch-listgroup-content-scrollbar-w: 3px;
22
+ --livesearch-listgroup-content-scrollbar-w: 10px;
23
23
  display: none;
24
24
  min-width: var(--livesearch-listgroup-popwin-min-width);
25
25
  z-index: 1055; /* --bs-modal-zindex */
@@ -8,7 +8,7 @@
8
8
  --m-select-body-font-size: 0.75rem;
9
9
  --m-select-scrollbar-color: rgba(0, 0, 0, 0.2);
10
10
  --m-select-scrollbar-track: rgba(0, 0, 0, 0);
11
- --m-select-scrollbar-w: 3px;
11
+ --m-select-scrollbar-w: 10px;
12
12
  --m-select-search-icon-color: #333;
13
13
  --m-select-body-bg: #fff;
14
14
  --m-select-header-bg: #dee2e6;
package/Select/index.css CHANGED
@@ -266,7 +266,7 @@
266
266
  --cus-sel-listgroup-item-hover-focus-bg: rgba(0,0,0,.1);
267
267
  --cus-sel-listgroup-content-scrollbar-color: rgba(0, 0, 0, 0.2);
268
268
  --cus-sel-listgroup-content-scrollbar-track: rgba(0, 0, 0, 0);
269
- --cus-sel-listgroup-content-scrollbar-w: 3px;
269
+ --cus-sel-listgroup-content-scrollbar-w: 10px;
270
270
  --cus-sel-listgroup-grouptitle-color: #a2a2a2;
271
271
  --cus-sel-listgroup-groupborder-color: #d8d8d8;
272
272
  display: none;
package/Select/index.js CHANGED
@@ -3591,6 +3591,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3591
3591
  var listRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3592
3592
  var listContentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3593
3593
  var optionsRes = options ? (0,initDefaultOptions.isJSON)(options) ? JSON.parse(options) : options : [];
3594
+ var LIST_CONTAINER_MAX_HEIGHT = 350;
3594
3595
  var keyboardSelectedItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3595
3596
 
3596
3597
  // return a array of options
@@ -3659,6 +3660,14 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3659
3660
  _useState22 = _slicedToArray(_useState21, 2),
3660
3661
  controlArr = _useState22[0],
3661
3662
  setControlArr = _useState22[1];
3663
+ var listContainerHeightLimit = function listContainerHeightLimit(num) {
3664
+ var res = num;
3665
+ if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
3666
+
3667
+ // Avoid the height of the child div containing decimal points and scrollbars
3668
+ res = res + 1;
3669
+ return res;
3670
+ };
3662
3671
  var multiSelControlOptionExist = function multiSelControlOptionExist(arr, val) {
3663
3672
  var _data = arr.filter(Boolean);
3664
3673
  return _data.map(function (v) {
@@ -4188,8 +4197,16 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4188
4197
 
4189
4198
  // STEP 2:
4190
4199
  //-----------
4191
- // Detect position
4192
- if (window.innerHeight - _triggerBox.top > 100) {
4200
+ // Detect content MAX HEIGHT and ACTUAL HEIGHT
4201
+ var _contentBox = listContentRef.current.getBoundingClientRect();
4202
+ var _contentOldHeight = listContentRef.current.clientHeight;
4203
+
4204
+ // height restrictions
4205
+ _contentOldHeight = listContainerHeightLimit(_contentOldHeight);
4206
+
4207
+ // You need to wait for the height of the pop-up container to be set
4208
+ // Detect position、
4209
+ if (window.innerHeight - _triggerBox.top > _contentOldHeight) {
4193
4210
  targetPos = 'bottom';
4194
4211
  } else {
4195
4212
  targetPos = 'top';
@@ -4198,11 +4215,12 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4198
4215
 
4199
4216
  // STEP 3:
4200
4217
  //-----------
4201
- // Detect content height
4202
- var _contentBox = listContentRef.current.getBoundingClientRect();
4203
- var _contentOldHeight = listContentRef.current.clientHeight;
4218
+ // Set the pop-up height
4204
4219
  if (targetPos === 'top') {
4205
4220
  contentMaxHeight = _triggerBox.top;
4221
+
4222
+ // height restrictions
4223
+ contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
4206
4224
  if (_contentBox.height > contentMaxHeight) {
4207
4225
  listContentRef.current.style.height = contentMaxHeight - contentHeightOffset + 'px';
4208
4226
  if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - contentHeightOffset;
@@ -4221,6 +4239,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4221
4239
  }
4222
4240
  if (targetPos === 'bottom') {
4223
4241
  contentMaxHeight = window.innerHeight - _triggerBox.bottom;
4242
+
4243
+ // height restrictions
4244
+ contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
4224
4245
  if (_contentBox.height > contentMaxHeight) {
4225
4246
  listContentRef.current.style.height = contentMaxHeight - 10 + 'px';
4226
4247
  if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - 10;
@@ -4346,6 +4367,10 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4346
4367
  var oldHeight = listContentRef.current.dataset.height;
4347
4368
  var pos = listContentRef.current.dataset.pos;
4348
4369
  var filteredHeight = listContentRef.current.firstChild.clientHeight;
4370
+
4371
+ // height restrictions
4372
+ oldHeight = listContainerHeightLimit(oldHeight);
4373
+ filteredHeight = listContainerHeightLimit(filteredHeight);
4349
4374
  if (parseFloat(oldHeight) > filteredHeight) {
4350
4375
  listContentRef.current.style.height = filteredHeight + 'px';
4351
4376
  } else {
package/Table/index.css CHANGED
@@ -8,7 +8,7 @@
8
8
  --syntable-scrollbar-color: rgba(0, 0, 0, 0.2);
9
9
  --syntable-scrollbar-track: rgba(0, 0, 0, 0);
10
10
  --syntable-scrollbar-h: 3px;
11
- --syntable-scrollbar-w: 3px;
11
+ --syntable-scrollbar-w: 10px;
12
12
  --syntable-padding-x: 1rem;
13
13
  --syntable-padding-y: 0.5rem;
14
14
  --syntable-cell-focus-shadow: inset 0px 0px 2px 0px rgba(13, 110, 253, 2.25);
@@ -3591,6 +3591,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3591
3591
  var listRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3592
3592
  var listContentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3593
3593
  var optionsRes = options ? (0,initDefaultOptions.isJSON)(options) ? JSON.parse(options) : options : [];
3594
+ var LIST_CONTAINER_MAX_HEIGHT = 350;
3594
3595
  var keyboardSelectedItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
3595
3596
 
3596
3597
  // return a array of options
@@ -3659,6 +3660,14 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
3659
3660
  _useState22 = _slicedToArray(_useState21, 2),
3660
3661
  controlArr = _useState22[0],
3661
3662
  setControlArr = _useState22[1];
3663
+ var listContainerHeightLimit = function listContainerHeightLimit(num) {
3664
+ var res = num;
3665
+ if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
3666
+
3667
+ // Avoid the height of the child div containing decimal points and scrollbars
3668
+ res = res + 1;
3669
+ return res;
3670
+ };
3662
3671
  var multiSelControlOptionExist = function multiSelControlOptionExist(arr, val) {
3663
3672
  var _data = arr.filter(Boolean);
3664
3673
  return _data.map(function (v) {
@@ -4188,8 +4197,16 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4188
4197
 
4189
4198
  // STEP 2:
4190
4199
  //-----------
4191
- // Detect position
4192
- if (window.innerHeight - _triggerBox.top > 100) {
4200
+ // Detect content MAX HEIGHT and ACTUAL HEIGHT
4201
+ var _contentBox = listContentRef.current.getBoundingClientRect();
4202
+ var _contentOldHeight = listContentRef.current.clientHeight;
4203
+
4204
+ // height restrictions
4205
+ _contentOldHeight = listContainerHeightLimit(_contentOldHeight);
4206
+
4207
+ // You need to wait for the height of the pop-up container to be set
4208
+ // Detect position、
4209
+ if (window.innerHeight - _triggerBox.top > _contentOldHeight) {
4193
4210
  targetPos = 'bottom';
4194
4211
  } else {
4195
4212
  targetPos = 'top';
@@ -4198,11 +4215,12 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4198
4215
 
4199
4216
  // STEP 3:
4200
4217
  //-----------
4201
- // Detect content height
4202
- var _contentBox = listContentRef.current.getBoundingClientRect();
4203
- var _contentOldHeight = listContentRef.current.clientHeight;
4218
+ // Set the pop-up height
4204
4219
  if (targetPos === 'top') {
4205
4220
  contentMaxHeight = _triggerBox.top;
4221
+
4222
+ // height restrictions
4223
+ contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
4206
4224
  if (_contentBox.height > contentMaxHeight) {
4207
4225
  listContentRef.current.style.height = contentMaxHeight - contentHeightOffset + 'px';
4208
4226
  if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - contentHeightOffset;
@@ -4221,6 +4239,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4221
4239
  }
4222
4240
  if (targetPos === 'bottom') {
4223
4241
  contentMaxHeight = window.innerHeight - _triggerBox.bottom;
4242
+
4243
+ // height restrictions
4244
+ contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
4224
4245
  if (_contentBox.height > contentMaxHeight) {
4225
4246
  listContentRef.current.style.height = contentMaxHeight - 10 + 'px';
4226
4247
  if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - 10;
@@ -4346,6 +4367,10 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
4346
4367
  var oldHeight = listContentRef.current.dataset.height;
4347
4368
  var pos = listContentRef.current.dataset.pos;
4348
4369
  var filteredHeight = listContentRef.current.firstChild.clientHeight;
4370
+
4371
+ // height restrictions
4372
+ oldHeight = listContainerHeightLimit(oldHeight);
4373
+ filteredHeight = listContainerHeightLimit(filteredHeight);
4349
4374
  if (parseFloat(oldHeight) > filteredHeight) {
4350
4375
  listContentRef.current.style.height = filteredHeight + 'px';
4351
4376
  } else {
@@ -19,7 +19,7 @@
19
19
  --livesearch-listgroup-item-hover-focus-bg: rgba(0,0,0,.1);
20
20
  --livesearch-listgroup-content-scrollbar-color: rgba(0, 0, 0, 0.2);
21
21
  --livesearch-listgroup-content-scrollbar-track: rgba(0, 0, 0, 0);
22
- --livesearch-listgroup-content-scrollbar-w: 3px;
22
+ --livesearch-listgroup-content-scrollbar-w: 10px;
23
23
  display: none;
24
24
  min-width: var(--livesearch-listgroup-popwin-min-width);
25
25
  z-index: 1055; /* --bs-modal-zindex */
@@ -8,7 +8,7 @@
8
8
  --m-select-body-font-size: 0.75rem;
9
9
  --m-select-scrollbar-color: rgba(0, 0, 0, 0.2);
10
10
  --m-select-scrollbar-track: rgba(0, 0, 0, 0);
11
- --m-select-scrollbar-w: 3px;
11
+ --m-select-scrollbar-w: 10px;
12
12
  --m-select-search-icon-color: #333;
13
13
  --m-select-body-bg: #fff;
14
14
  --m-select-header-bg: #dee2e6;
@@ -266,7 +266,7 @@
266
266
  --cus-sel-listgroup-item-hover-focus-bg: rgba(0,0,0,.1);
267
267
  --cus-sel-listgroup-content-scrollbar-color: rgba(0, 0, 0, 0.2);
268
268
  --cus-sel-listgroup-content-scrollbar-track: rgba(0, 0, 0, 0);
269
- --cus-sel-listgroup-content-scrollbar-w: 3px;
269
+ --cus-sel-listgroup-content-scrollbar-w: 10px;
270
270
  --cus-sel-listgroup-grouptitle-color: #a2a2a2;
271
271
  --cus-sel-listgroup-groupborder-color: #d8d8d8;
272
272
  display: none;
@@ -8,7 +8,7 @@
8
8
  --syntable-scrollbar-color: rgba(0, 0, 0, 0.2);
9
9
  --syntable-scrollbar-track: rgba(0, 0, 0, 0);
10
10
  --syntable-scrollbar-h: 3px;
11
- --syntable-scrollbar-w: 3px;
11
+ --syntable-scrollbar-w: 10px;
12
12
  --syntable-padding-x: 1rem;
13
13
  --syntable-padding-y: 0.5rem;
14
14
  --syntable-cell-focus-shadow: inset 0px 0px 2px 0px rgba(13, 110, 253, 2.25);
@@ -23,7 +23,7 @@
23
23
  --livesearch-listgroup-item-hover-focus-bg: rgba(0,0,0,.1);
24
24
  --livesearch-listgroup-content-scrollbar-color: rgba(0, 0, 0, 0.2);
25
25
  --livesearch-listgroup-content-scrollbar-track: rgba(0, 0, 0, 0);
26
- --livesearch-listgroup-content-scrollbar-w: 3px;
26
+ --livesearch-listgroup-content-scrollbar-w: 10px;
27
27
 
28
28
 
29
29
  display: none;
@@ -10,7 +10,7 @@
10
10
  --m-select-body-font-size: 0.75rem;
11
11
  --m-select-scrollbar-color: rgba(0, 0, 0, 0.2);
12
12
  --m-select-scrollbar-track: rgba(0, 0, 0, 0);
13
- --m-select-scrollbar-w: 3px;
13
+ --m-select-scrollbar-w: 10px;
14
14
  --m-select-search-icon-color: #333;
15
15
  --m-select-body-bg: #fff;
16
16
  --m-select-header-bg: #dee2e6;
@@ -380,7 +380,7 @@
380
380
  --cus-sel-listgroup-item-hover-focus-bg: rgba(0,0,0,.1);
381
381
  --cus-sel-listgroup-content-scrollbar-color: rgba(0, 0, 0, 0.2);
382
382
  --cus-sel-listgroup-content-scrollbar-track: rgba(0, 0, 0, 0);
383
- --cus-sel-listgroup-content-scrollbar-w: 3px;
383
+ --cus-sel-listgroup-content-scrollbar-w: 10px;
384
384
  --cus-sel-listgroup-grouptitle-color: #a2a2a2;
385
385
  --cus-sel-listgroup-groupborder-color: #d8d8d8;
386
386
 
@@ -50,6 +50,7 @@ import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
50
50
 
51
51
 
52
52
 
53
+
53
54
  export type SelectOptionChangeFnType = (arg1: any, arg2: any, arg3: any) => void;
54
55
 
55
56
  export interface MultiSelectDataConfig {
@@ -240,6 +241,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
240
241
  const listRef = useRef<any>(null);
241
242
  const listContentRef = useRef<any>(null);
242
243
  const optionsRes = options ? (isJSON(options) ? JSON.parse(options as string) : options) : [];
244
+ const LIST_CONTAINER_MAX_HEIGHT = 350;
243
245
 
244
246
  const keyboardSelectedItem = useRef<any>(null);
245
247
 
@@ -284,6 +286,16 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
284
286
  });
285
287
 
286
288
 
289
+ const listContainerHeightLimit = (num: number) => {
290
+ let res = num;
291
+ if (res > LIST_CONTAINER_MAX_HEIGHT) res = LIST_CONTAINER_MAX_HEIGHT;
292
+
293
+ // Avoid the height of the child div containing decimal points and scrollbars
294
+ res = res + 1;
295
+
296
+ return res;
297
+ };
298
+
287
299
  const multiSelControlOptionExist = (arr: any[], val: any) => {
288
300
  const _data = arr.filter(Boolean);
289
301
  return _data.map((v: any) => v.toString()).includes(val.toString());
@@ -864,10 +876,20 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
864
876
  _modalRef.classList.add('active');
865
877
 
866
878
 
879
+
880
+
867
881
  // STEP 2:
868
882
  //-----------
869
- // Detect position
870
- if (window.innerHeight - _triggerBox.top > 100) {
883
+ // Detect content MAX HEIGHT and ACTUAL HEIGHT
884
+ const _contentBox = listContentRef.current.getBoundingClientRect();
885
+ let _contentOldHeight = listContentRef.current.clientHeight;
886
+
887
+ // height restrictions
888
+ _contentOldHeight = listContainerHeightLimit(_contentOldHeight);
889
+
890
+ // You need to wait for the height of the pop-up container to be set
891
+ // Detect position、
892
+ if (window.innerHeight - _triggerBox.top > _contentOldHeight) {
871
893
  targetPos = 'bottom';
872
894
  } else {
873
895
  targetPos = 'top';
@@ -879,13 +901,14 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
879
901
 
880
902
  // STEP 3:
881
903
  //-----------
882
- // Detect content height
883
- const _contentBox = listContentRef.current.getBoundingClientRect();
884
- const _contentOldHeight = listContentRef.current.clientHeight;
885
-
904
+ // Set the pop-up height
886
905
  if (targetPos === 'top') {
887
906
  contentMaxHeight = _triggerBox.top;
888
907
 
908
+ // height restrictions
909
+ contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
910
+
911
+
889
912
  if (_contentBox.height > contentMaxHeight) {
890
913
  listContentRef.current.style.height = contentMaxHeight - contentHeightOffset + 'px';
891
914
  if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - contentHeightOffset;
@@ -908,6 +931,11 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
908
931
  if (targetPos === 'bottom') {
909
932
  contentMaxHeight = window.innerHeight - _triggerBox.bottom;
910
933
 
934
+
935
+ // height restrictions
936
+ contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
937
+
938
+
911
939
  if (_contentBox.height > contentMaxHeight) {
912
940
  listContentRef.current.style.height = contentMaxHeight - 10 + 'px';
913
941
  if (typeof listContentRef.current.dataset.height === 'undefined') listContentRef.current.dataset.height = contentMaxHeight - 10;
@@ -988,6 +1016,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
988
1016
  // no data label
989
1017
  popwinNoMatchInit();
990
1018
 
1019
+
991
1020
  }
992
1021
 
993
1022
 
@@ -1077,9 +1106,14 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
1077
1106
  function popwinContainerHeightAdjust() {
1078
1107
  if (listContentRef.current === null) return;
1079
1108
 
1080
- const oldHeight = listContentRef.current.dataset.height;
1109
+ let oldHeight = listContentRef.current.dataset.height;
1081
1110
  const pos = listContentRef.current.dataset.pos;
1082
- const filteredHeight = listContentRef.current.firstChild.clientHeight;
1111
+ let filteredHeight = listContentRef.current.firstChild.clientHeight;
1112
+
1113
+ // height restrictions
1114
+ oldHeight = listContainerHeightLimit(oldHeight);
1115
+ filteredHeight = listContainerHeightLimit(filteredHeight);
1116
+
1083
1117
 
1084
1118
  if (parseFloat(oldHeight) > filteredHeight) {
1085
1119
  listContentRef.current.style.height = filteredHeight + 'px';
@@ -8,7 +8,7 @@
8
8
  --syntable-scrollbar-color: rgba(0, 0, 0, 0.2);
9
9
  --syntable-scrollbar-track: rgba(0, 0, 0, 0);
10
10
  --syntable-scrollbar-h: 3px;
11
- --syntable-scrollbar-w: 3px;
11
+ --syntable-scrollbar-w: 10px;
12
12
  --syntable-padding-x: 1rem;
13
13
  --syntable-padding-y: 0.5rem;
14
14
  --syntable-cell-focus-shadow: inset 0px 0px 2px 0px rgba(13, 110, 253, 2.25);
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.512",
5
+ "version": "4.5.522",
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",