funda-ui 4.7.555 → 4.7.562
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 +0 -1
- package/LiveSearch/index.js +5 -4
- package/Select/index.js +19 -16
- package/lib/cjs/Date/index.js +0 -1
- package/lib/cjs/LiveSearch/index.js +5 -4
- package/lib/cjs/Select/index.js +19 -16
- package/lib/esm/Date/index.tsx +0 -1
- package/lib/esm/LiveSearch/index.tsx +5 -4
- package/lib/esm/Select/index.tsx +29 -20
- package/package.json +1 -1
package/Date/index.js
CHANGED
|
@@ -5346,7 +5346,6 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
5346
5346
|
_modalRef.style.top = 'auto';
|
|
5347
5347
|
_modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
|
|
5348
5348
|
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
5349
|
-
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
5350
5349
|
_modalRef.classList.add('pos-top');
|
|
5351
5350
|
}
|
|
5352
5351
|
if (targetPos === 'bottom') {
|
package/LiveSearch/index.js
CHANGED
|
@@ -3104,16 +3104,17 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
|
|
|
3104
3104
|
// Adjust position
|
|
3105
3105
|
if (targetPos === 'top') {
|
|
3106
3106
|
_modalRef.style.left = x + 'px';
|
|
3107
|
-
_modalRef.style.
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
_modalRef.style.
|
|
3107
|
+
//_modalRef.style.top = y - POS_OFFSET - (listRef.current.clientHeight) - 2 + 'px';
|
|
3108
|
+
_modalRef.style.top = 'auto';
|
|
3109
|
+
_modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
|
|
3110
|
+
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
3111
3111
|
_modalRef.classList.add('pos-top');
|
|
3112
3112
|
}
|
|
3113
3113
|
if (targetPos === 'bottom') {
|
|
3114
3114
|
_modalRef.style.left = x + 'px';
|
|
3115
3115
|
_modalRef.style.bottom = 'auto';
|
|
3116
3116
|
_modalRef.style.top = y + height + POS_OFFSET + 'px';
|
|
3117
|
+
_modalRef.style.setProperty('position', 'absolute', 'important');
|
|
3117
3118
|
_modalRef.classList.remove('pos-top');
|
|
3118
3119
|
}
|
|
3119
3120
|
|
package/Select/index.js
CHANGED
|
@@ -4424,16 +4424,17 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4424
4424
|
// Adjust position
|
|
4425
4425
|
if (targetPos === 'top') {
|
|
4426
4426
|
_modalRef.style.left = x + 'px';
|
|
4427
|
-
_modalRef.style.
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
_modalRef.style.
|
|
4427
|
+
//_modalRef.style.top = y - POS_OFFSET - (listRef.current.clientHeight) - 2 + 'px';
|
|
4428
|
+
_modalRef.style.top = 'auto';
|
|
4429
|
+
_modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
|
|
4430
|
+
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
4431
4431
|
_modalRef.classList.add('pos-top');
|
|
4432
4432
|
}
|
|
4433
4433
|
if (targetPos === 'bottom') {
|
|
4434
4434
|
_modalRef.style.left = x + 'px';
|
|
4435
4435
|
_modalRef.style.bottom = 'auto';
|
|
4436
4436
|
_modalRef.style.top = y + height + POS_OFFSET + 'px';
|
|
4437
|
+
_modalRef.style.setProperty('position', 'absolute', 'important');
|
|
4437
4438
|
_modalRef.classList.remove('pos-top');
|
|
4438
4439
|
}
|
|
4439
4440
|
|
|
@@ -4578,7 +4579,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4578
4579
|
function popwinContainerHeightAdjust() {
|
|
4579
4580
|
if (listContentRef.current === null) return;
|
|
4580
4581
|
var oldHeight = listContentRef.current.dataset.height;
|
|
4581
|
-
var pos = listContentRef.current.dataset.pos;
|
|
4582
4582
|
var filteredHeight = listContentRef.current.firstChild.clientHeight;
|
|
4583
4583
|
|
|
4584
4584
|
// height restrictions
|
|
@@ -4586,21 +4586,24 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4586
4586
|
filteredHeight = listContainerHeightLimit(filteredHeight);
|
|
4587
4587
|
if (parseFloat(oldHeight) > filteredHeight) {
|
|
4588
4588
|
listContentRef.current.style.height = filteredHeight + 'px';
|
|
4589
|
+
console.log('popwinContainerHeightAdjust - height changed to:', filteredHeight);
|
|
4589
4590
|
} else {
|
|
4590
4591
|
listContentRef.current.style.height = oldHeight + 'px';
|
|
4592
|
+
console.log('popwinContainerHeightAdjust - height kept as:', oldHeight);
|
|
4591
4593
|
}
|
|
4592
4594
|
}
|
|
4593
4595
|
function popwinNoMatchInit() {
|
|
4594
4596
|
if (listContentRef.current === null) return;
|
|
4595
4597
|
var _btnSelectAll = listContentRef.current.querySelector('.custom-select-multi__control-option-item--select-all');
|
|
4596
4598
|
var _noDataDiv = listContentRef.current.querySelector('.custom-select-multi__control-option-item--nomatch');
|
|
4597
|
-
var
|
|
4599
|
+
var _items = [].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item'));
|
|
4600
|
+
var itemsDoNotExist = _items.every(function (node) {
|
|
4598
4601
|
if (!node.classList.contains('hide')) {
|
|
4599
4602
|
return false;
|
|
4600
4603
|
}
|
|
4601
4604
|
return true;
|
|
4602
4605
|
});
|
|
4603
|
-
if (
|
|
4606
|
+
if (itemsDoNotExist) {
|
|
4604
4607
|
_noDataDiv.classList.remove('hide');
|
|
4605
4608
|
if (_btnSelectAll !== null) _btnSelectAll.classList.add('hide');
|
|
4606
4609
|
} else {
|
|
@@ -5468,6 +5471,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5468
5471
|
}
|
|
5469
5472
|
}
|
|
5470
5473
|
|
|
5474
|
+
// Select all detection functions in the input box (for "Single selection")
|
|
5475
|
+
function checkUserInputboxIsAllSelected(e) {
|
|
5476
|
+
var input = e.target;
|
|
5477
|
+
if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
|
|
5478
|
+
setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
|
|
5479
|
+
} else {
|
|
5480
|
+
setUserInputboxIsAllSelected(false);
|
|
5481
|
+
}
|
|
5482
|
+
}
|
|
5471
5483
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
5472
5484
|
// Call a function when the component has been rendered completely
|
|
5473
5485
|
//--------------
|
|
@@ -5619,15 +5631,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5619
5631
|
};
|
|
5620
5632
|
}, [orginalData]); // Avoid the issue that `setOptionsData(orginalData)` sets the original value to empty on the first entry
|
|
5621
5633
|
|
|
5622
|
-
// Select all detection functions in the input box (for "Single selection")
|
|
5623
|
-
function checkUserInputboxIsAllSelected(e) {
|
|
5624
|
-
var input = e.target;
|
|
5625
|
-
if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
|
|
5626
|
-
setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
|
|
5627
|
-
} else {
|
|
5628
|
-
setUserInputboxIsAllSelected(false);
|
|
5629
|
-
}
|
|
5630
|
-
}
|
|
5631
5634
|
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", {
|
|
5632
5635
|
className: "custom-select__label"
|
|
5633
5636
|
}, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
|
package/lib/cjs/Date/index.js
CHANGED
|
@@ -5346,7 +5346,6 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
5346
5346
|
_modalRef.style.top = 'auto';
|
|
5347
5347
|
_modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
|
|
5348
5348
|
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
5349
|
-
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
5350
5349
|
_modalRef.classList.add('pos-top');
|
|
5351
5350
|
}
|
|
5352
5351
|
if (targetPos === 'bottom') {
|
|
@@ -3104,16 +3104,17 @@ var LiveSearch = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
|
|
|
3104
3104
|
// Adjust position
|
|
3105
3105
|
if (targetPos === 'top') {
|
|
3106
3106
|
_modalRef.style.left = x + 'px';
|
|
3107
|
-
_modalRef.style.
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
_modalRef.style.
|
|
3107
|
+
//_modalRef.style.top = y - POS_OFFSET - (listRef.current.clientHeight) - 2 + 'px';
|
|
3108
|
+
_modalRef.style.top = 'auto';
|
|
3109
|
+
_modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
|
|
3110
|
+
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
3111
3111
|
_modalRef.classList.add('pos-top');
|
|
3112
3112
|
}
|
|
3113
3113
|
if (targetPos === 'bottom') {
|
|
3114
3114
|
_modalRef.style.left = x + 'px';
|
|
3115
3115
|
_modalRef.style.bottom = 'auto';
|
|
3116
3116
|
_modalRef.style.top = y + height + POS_OFFSET + 'px';
|
|
3117
|
+
_modalRef.style.setProperty('position', 'absolute', 'important');
|
|
3117
3118
|
_modalRef.classList.remove('pos-top');
|
|
3118
3119
|
}
|
|
3119
3120
|
|
package/lib/cjs/Select/index.js
CHANGED
|
@@ -4424,16 +4424,17 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4424
4424
|
// Adjust position
|
|
4425
4425
|
if (targetPos === 'top') {
|
|
4426
4426
|
_modalRef.style.left = x + 'px';
|
|
4427
|
-
_modalRef.style.
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
_modalRef.style.
|
|
4427
|
+
//_modalRef.style.top = y - POS_OFFSET - (listRef.current.clientHeight) - 2 + 'px';
|
|
4428
|
+
_modalRef.style.top = 'auto';
|
|
4429
|
+
_modalRef.style.bottom = window.innerHeight - _triggerBox.top + POS_OFFSET + 2 + 'px';
|
|
4430
|
+
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
4431
4431
|
_modalRef.classList.add('pos-top');
|
|
4432
4432
|
}
|
|
4433
4433
|
if (targetPos === 'bottom') {
|
|
4434
4434
|
_modalRef.style.left = x + 'px';
|
|
4435
4435
|
_modalRef.style.bottom = 'auto';
|
|
4436
4436
|
_modalRef.style.top = y + height + POS_OFFSET + 'px';
|
|
4437
|
+
_modalRef.style.setProperty('position', 'absolute', 'important');
|
|
4437
4438
|
_modalRef.classList.remove('pos-top');
|
|
4438
4439
|
}
|
|
4439
4440
|
|
|
@@ -4578,7 +4579,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4578
4579
|
function popwinContainerHeightAdjust() {
|
|
4579
4580
|
if (listContentRef.current === null) return;
|
|
4580
4581
|
var oldHeight = listContentRef.current.dataset.height;
|
|
4581
|
-
var pos = listContentRef.current.dataset.pos;
|
|
4582
4582
|
var filteredHeight = listContentRef.current.firstChild.clientHeight;
|
|
4583
4583
|
|
|
4584
4584
|
// height restrictions
|
|
@@ -4586,21 +4586,24 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4586
4586
|
filteredHeight = listContainerHeightLimit(filteredHeight);
|
|
4587
4587
|
if (parseFloat(oldHeight) > filteredHeight) {
|
|
4588
4588
|
listContentRef.current.style.height = filteredHeight + 'px';
|
|
4589
|
+
console.log('popwinContainerHeightAdjust - height changed to:', filteredHeight);
|
|
4589
4590
|
} else {
|
|
4590
4591
|
listContentRef.current.style.height = oldHeight + 'px';
|
|
4592
|
+
console.log('popwinContainerHeightAdjust - height kept as:', oldHeight);
|
|
4591
4593
|
}
|
|
4592
4594
|
}
|
|
4593
4595
|
function popwinNoMatchInit() {
|
|
4594
4596
|
if (listContentRef.current === null) return;
|
|
4595
4597
|
var _btnSelectAll = listContentRef.current.querySelector('.custom-select-multi__control-option-item--select-all');
|
|
4596
4598
|
var _noDataDiv = listContentRef.current.querySelector('.custom-select-multi__control-option-item--nomatch');
|
|
4597
|
-
var
|
|
4599
|
+
var _items = [].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item'));
|
|
4600
|
+
var itemsDoNotExist = _items.every(function (node) {
|
|
4598
4601
|
if (!node.classList.contains('hide')) {
|
|
4599
4602
|
return false;
|
|
4600
4603
|
}
|
|
4601
4604
|
return true;
|
|
4602
4605
|
});
|
|
4603
|
-
if (
|
|
4606
|
+
if (itemsDoNotExist) {
|
|
4604
4607
|
_noDataDiv.classList.remove('hide');
|
|
4605
4608
|
if (_btnSelectAll !== null) _btnSelectAll.classList.add('hide');
|
|
4606
4609
|
} else {
|
|
@@ -5468,6 +5471,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5468
5471
|
}
|
|
5469
5472
|
}
|
|
5470
5473
|
|
|
5474
|
+
// Select all detection functions in the input box (for "Single selection")
|
|
5475
|
+
function checkUserInputboxIsAllSelected(e) {
|
|
5476
|
+
var input = e.target;
|
|
5477
|
+
if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
|
|
5478
|
+
setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
|
|
5479
|
+
} else {
|
|
5480
|
+
setUserInputboxIsAllSelected(false);
|
|
5481
|
+
}
|
|
5482
|
+
}
|
|
5471
5483
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
5472
5484
|
// Call a function when the component has been rendered completely
|
|
5473
5485
|
//--------------
|
|
@@ -5619,15 +5631,6 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5619
5631
|
};
|
|
5620
5632
|
}, [orginalData]); // Avoid the issue that `setOptionsData(orginalData)` sets the original value to empty on the first entry
|
|
5621
5633
|
|
|
5622
|
-
// Select all detection functions in the input box (for "Single selection")
|
|
5623
|
-
function checkUserInputboxIsAllSelected(e) {
|
|
5624
|
-
var input = e.target;
|
|
5625
|
-
if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
|
|
5626
|
-
setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
|
|
5627
|
-
} else {
|
|
5628
|
-
setUserInputboxIsAllSelected(false);
|
|
5629
|
-
}
|
|
5630
|
-
}
|
|
5631
5634
|
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", {
|
|
5632
5635
|
className: "custom-select__label"
|
|
5633
5636
|
}, typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("label", {
|
package/lib/esm/Date/index.tsx
CHANGED
|
@@ -540,7 +540,6 @@ const Date = forwardRef((props: DateProps, externalRef: any) => {
|
|
|
540
540
|
_modalRef.style.top = 'auto';
|
|
541
541
|
_modalRef.style.bottom = (window.innerHeight - _triggerBox.top) + POS_OFFSET + 2 + 'px';
|
|
542
542
|
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
543
|
-
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
544
543
|
_modalRef.classList.add('pos-top');
|
|
545
544
|
}
|
|
546
545
|
|
|
@@ -362,10 +362,10 @@ const LiveSearch = forwardRef((props: LiveSearchProps, externalRef: any) => {
|
|
|
362
362
|
// Adjust position
|
|
363
363
|
if (targetPos === 'top') {
|
|
364
364
|
_modalRef.style.left = x + 'px';
|
|
365
|
-
_modalRef.style.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
_modalRef.style.
|
|
365
|
+
//_modalRef.style.top = y - POS_OFFSET - (listRef.current.clientHeight) - 2 + 'px';
|
|
366
|
+
_modalRef.style.top = 'auto';
|
|
367
|
+
_modalRef.style.bottom = (window.innerHeight - _triggerBox.top) + POS_OFFSET + 2 + 'px';
|
|
368
|
+
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
369
369
|
_modalRef.classList.add('pos-top');
|
|
370
370
|
|
|
371
371
|
}
|
|
@@ -374,6 +374,7 @@ const LiveSearch = forwardRef((props: LiveSearchProps, externalRef: any) => {
|
|
|
374
374
|
_modalRef.style.left = x + 'px';
|
|
375
375
|
_modalRef.style.bottom = 'auto';
|
|
376
376
|
_modalRef.style.top = y + height + POS_OFFSET + 'px';
|
|
377
|
+
_modalRef.style.setProperty('position', 'absolute', 'important');
|
|
377
378
|
_modalRef.classList.remove('pos-top');
|
|
378
379
|
}
|
|
379
380
|
|
package/lib/esm/Select/index.tsx
CHANGED
|
@@ -47,7 +47,6 @@ import {
|
|
|
47
47
|
import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
|
|
51
50
|
export interface MultiSelectValue {
|
|
52
51
|
items: { label: string; value: string }[];
|
|
53
52
|
labels: string[];
|
|
@@ -273,7 +272,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
273
272
|
|
|
274
273
|
|
|
275
274
|
// loading
|
|
276
|
-
const [fetchLoading, setFetchLoading] = useState(false);
|
|
275
|
+
const [fetchLoading, setFetchLoading] = useState<boolean>(false);
|
|
277
276
|
const loadingOutput = <><div className="cus-select-loader">{loader || <svg height="12px" width="12px" viewBox="0 0 512 512"><g><path fill="inherit" d="M256,0c-23.357,0-42.297,18.932-42.297,42.288c0,23.358,18.94,42.288,42.297,42.288c23.357,0,42.279-18.93,42.279-42.288C298.279,18.932,279.357,0,256,0z" /><path fill="inherit" d="M256,427.424c-23.357,0-42.297,18.931-42.297,42.288C213.703,493.07,232.643,512,256,512c23.357,0,42.279-18.93,42.279-42.288C298.279,446.355,279.357,427.424,256,427.424z" /><path fill="inherit" d="M74.974,74.983c-16.52,16.511-16.52,43.286,0,59.806c16.52,16.52,43.287,16.52,59.806,0c16.52-16.511,16.52-43.286,0-59.806C118.261,58.463,91.494,58.463,74.974,74.983z" /><path fill="inherit" d="M377.203,377.211c-16.503,16.52-16.503,43.296,0,59.815c16.519,16.52,43.304,16.52,59.806,0c16.52-16.51,16.52-43.295,0-59.815C420.489,360.692,393.722,360.7,377.203,377.211z" /><path fill="inherit" d="M84.567,256c0.018-23.348-18.922-42.279-42.279-42.279c-23.357-0.009-42.297,18.932-42.279,42.288c-0.018,23.348,18.904,42.279,42.279,42.279C65.645,298.288,84.567,279.358,84.567,256z" /><path fill="inherit" d="M469.712,213.712c-23.357,0-42.279,18.941-42.297,42.288c0,23.358,18.94,42.288,42.297,42.297c23.357,0,42.297-18.94,42.279-42.297C512.009,232.652,493.069,213.712,469.712,213.712z" /><path fill="inherit" d="M74.991,377.22c-16.519,16.511-16.519,43.296,0,59.806c16.503,16.52,43.27,16.52,59.789,0c16.52-16.519,16.52-43.295,0-59.815C118.278,360.692,91.511,360.692,74.991,377.22z" /><path fill="inherit" 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" /></g></svg>}</div></>;
|
|
278
277
|
|
|
279
278
|
|
|
@@ -500,16 +499,18 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
500
499
|
|
|
501
500
|
// Make a request
|
|
502
501
|
handleFetch(val).then((response: any) => {
|
|
503
|
-
|
|
502
|
+
|
|
504
503
|
// pop win initalization
|
|
505
504
|
setTimeout(() => {
|
|
506
505
|
popwinPosInit();
|
|
507
506
|
popwinFilterItems(val);
|
|
507
|
+
|
|
508
508
|
}, 0);
|
|
509
509
|
|
|
510
510
|
setFetchLoading(false);
|
|
511
511
|
});
|
|
512
512
|
} else {
|
|
513
|
+
|
|
513
514
|
|
|
514
515
|
// pop win initalization
|
|
515
516
|
setTimeout(() => {
|
|
@@ -966,10 +967,10 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
966
967
|
// Adjust position
|
|
967
968
|
if (targetPos === 'top') {
|
|
968
969
|
_modalRef.style.left = x + 'px';
|
|
969
|
-
_modalRef.style.
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
_modalRef.style.
|
|
970
|
+
//_modalRef.style.top = y - POS_OFFSET - (listRef.current.clientHeight) - 2 + 'px';
|
|
971
|
+
_modalRef.style.top = 'auto';
|
|
972
|
+
_modalRef.style.bottom = (window.innerHeight - _triggerBox.top) + POS_OFFSET + 2 + 'px';
|
|
973
|
+
_modalRef.style.setProperty('position', 'fixed', 'important');
|
|
973
974
|
_modalRef.classList.add('pos-top');
|
|
974
975
|
|
|
975
976
|
}
|
|
@@ -978,6 +979,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
978
979
|
_modalRef.style.left = x + 'px';
|
|
979
980
|
_modalRef.style.bottom = 'auto';
|
|
980
981
|
_modalRef.style.top = y + height + POS_OFFSET + 'px';
|
|
982
|
+
_modalRef.style.setProperty('position', 'absolute', 'important');
|
|
981
983
|
_modalRef.classList.remove('pos-top');
|
|
982
984
|
}
|
|
983
985
|
|
|
@@ -1166,7 +1168,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1166
1168
|
if (listContentRef.current === null) return;
|
|
1167
1169
|
|
|
1168
1170
|
let oldHeight = listContentRef.current.dataset.height;
|
|
1169
|
-
const pos = listContentRef.current.dataset.pos;
|
|
1170
1171
|
let filteredHeight = listContentRef.current.firstChild.clientHeight;
|
|
1171
1172
|
|
|
1172
1173
|
// height restrictions
|
|
@@ -1176,8 +1177,10 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1176
1177
|
|
|
1177
1178
|
if (parseFloat(oldHeight) > filteredHeight) {
|
|
1178
1179
|
listContentRef.current.style.height = filteredHeight + 'px';
|
|
1180
|
+
console.log('popwinContainerHeightAdjust - height changed to:', filteredHeight);
|
|
1179
1181
|
} else {
|
|
1180
1182
|
listContentRef.current.style.height = oldHeight + 'px';
|
|
1183
|
+
console.log('popwinContainerHeightAdjust - height kept as:', oldHeight);
|
|
1181
1184
|
}
|
|
1182
1185
|
|
|
1183
1186
|
}
|
|
@@ -1190,14 +1193,15 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1190
1193
|
|
|
1191
1194
|
const _btnSelectAll = listContentRef.current.querySelector('.custom-select-multi__control-option-item--select-all');
|
|
1192
1195
|
const _noDataDiv = listContentRef.current.querySelector('.custom-select-multi__control-option-item--nomatch');
|
|
1193
|
-
const
|
|
1196
|
+
const _items = [].slice.call(listContentRef.current.querySelectorAll('.custom-select-multi__control-option-item'));
|
|
1197
|
+
const itemsDoNotExist = _items.every((node: any) => {
|
|
1194
1198
|
if (!node.classList.contains('hide')) {
|
|
1195
1199
|
return false;
|
|
1196
1200
|
}
|
|
1197
1201
|
return true;
|
|
1198
1202
|
});
|
|
1199
1203
|
|
|
1200
|
-
if (
|
|
1204
|
+
if (itemsDoNotExist) {
|
|
1201
1205
|
_noDataDiv.classList.remove('hide');
|
|
1202
1206
|
if (_btnSelectAll !== null) _btnSelectAll.classList.add('hide');
|
|
1203
1207
|
} else {
|
|
@@ -1221,6 +1225,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1221
1225
|
|
|
1222
1226
|
}
|
|
1223
1227
|
|
|
1228
|
+
|
|
1229
|
+
|
|
1224
1230
|
function cancel() {
|
|
1225
1231
|
// hide list
|
|
1226
1232
|
setIsOpen(false);
|
|
@@ -1919,7 +1925,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1919
1925
|
if (MANUAL_REQ && val !== '') {
|
|
1920
1926
|
popwinPosInit();
|
|
1921
1927
|
}
|
|
1922
|
-
|
|
1923
1928
|
|
|
1924
1929
|
}
|
|
1925
1930
|
|
|
@@ -2112,6 +2117,17 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
2112
2117
|
}
|
|
2113
2118
|
|
|
2114
2119
|
|
|
2120
|
+
// Select all detection functions in the input box (for "Single selection")
|
|
2121
|
+
function checkUserInputboxIsAllSelected(e: any) {
|
|
2122
|
+
const input = e.target;
|
|
2123
|
+
if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
|
|
2124
|
+
setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
|
|
2125
|
+
} else {
|
|
2126
|
+
setUserInputboxIsAllSelected(false);
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
|
|
2115
2131
|
useEffect(() => {
|
|
2116
2132
|
|
|
2117
2133
|
// Call a function when the component has been rendered completely
|
|
@@ -2278,15 +2294,6 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
2278
2294
|
}, [orginalData]); // Avoid the issue that `setOptionsData(orginalData)` sets the original value to empty on the first entry
|
|
2279
2295
|
|
|
2280
2296
|
|
|
2281
|
-
// Select all detection functions in the input box (for "Single selection")
|
|
2282
|
-
function checkUserInputboxIsAllSelected(e: any) {
|
|
2283
|
-
const input = e.target;
|
|
2284
|
-
if (input && typeof input.selectionStart === 'number' && typeof input.selectionEnd === 'number') {
|
|
2285
|
-
setUserInputboxIsAllSelected(input.selectionStart === 0 && input.selectionEnd === input.value.length && input.value.length > 0);
|
|
2286
|
-
} else {
|
|
2287
|
-
setUserInputboxIsAllSelected(false);
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
2297
|
|
|
2291
2298
|
|
|
2292
2299
|
return (
|
|
@@ -2515,6 +2522,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
2515
2522
|
setTimeout(() => {
|
|
2516
2523
|
popwinPosInit();
|
|
2517
2524
|
popwinFilterItems(controlTempValue);
|
|
2525
|
+
|
|
2518
2526
|
}, 0);
|
|
2519
2527
|
});
|
|
2520
2528
|
|
|
@@ -2787,6 +2795,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
2787
2795
|
setTimeout(() => {
|
|
2788
2796
|
popwinPosInit();
|
|
2789
2797
|
popwinFilterItems(controlTempValue);
|
|
2798
|
+
|
|
2790
2799
|
}, 0);
|
|
2791
2800
|
});
|
|
2792
2801
|
}}>
|
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.
|
|
5
|
+
"version": "4.7.562",
|
|
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",
|