funda-ui 4.7.512 → 4.7.517
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 +7 -5
- package/Select/index.js +110 -88
- package/Table/index.js +46 -50
- package/lib/cjs/Date/index.js +7 -5
- package/lib/cjs/Select/index.js +110 -88
- package/lib/cjs/Table/index.js +46 -50
- package/lib/esm/Date/index.tsx +4 -2
- package/lib/esm/Select/index.tsx +165 -148
- package/lib/esm/Table/utils/hooks/useTableKeyPress.tsx +42 -43
- package/package.json +1 -1
package/Date/index.js
CHANGED
|
@@ -5471,14 +5471,16 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
5471
5471
|
}
|
|
5472
5472
|
function _handleKeyPressedForSplitInputs() {
|
|
5473
5473
|
_handleKeyPressedForSplitInputs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
5474
|
-
var key, btnMark, isLeftArrow, isRightArrow, move;
|
|
5474
|
+
var key, btnMark, isNumLockOn, isLeftArrow, isRightArrow, move;
|
|
5475
5475
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
5476
5476
|
while (1) switch (_context2.prev = _context2.next) {
|
|
5477
5477
|
case 0:
|
|
5478
5478
|
key = event.code;
|
|
5479
|
-
btnMark = event.target.dataset.mark;
|
|
5480
|
-
|
|
5481
|
-
|
|
5479
|
+
btnMark = event.target.dataset.mark;
|
|
5480
|
+
isNumLockOn = event.getModifierState && event.getModifierState('NumLock'); // Check for both regular arrow keys and numpad arrow keys
|
|
5481
|
+
// Numpad2/4/6/8 trigger direction is allowed only when NumLock is off
|
|
5482
|
+
isLeftArrow = key === 'ArrowLeft' || key === 'Numpad4' && !isNumLockOn;
|
|
5483
|
+
isRightArrow = key === 'ArrowRight' || key === 'Numpad6' && !isNumLockOn;
|
|
5482
5484
|
move = function move(direction) {
|
|
5483
5485
|
var currentIndex = splitInputsIds.findIndex(function (s) {
|
|
5484
5486
|
return s === btnMark;
|
|
@@ -5499,7 +5501,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
5499
5501
|
if (isRightArrow) {
|
|
5500
5502
|
move('right');
|
|
5501
5503
|
}
|
|
5502
|
-
case
|
|
5504
|
+
case 8:
|
|
5503
5505
|
case "end":
|
|
5504
5506
|
return _context2.stop();
|
|
5505
5507
|
}
|
package/Select/index.js
CHANGED
|
@@ -3703,54 +3703,92 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3703
3703
|
var LIST_CONTAINER_MAX_HEIGHT = 300;
|
|
3704
3704
|
var keyboardSelectedItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3705
3705
|
|
|
3706
|
+
// loading
|
|
3707
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3708
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3709
|
+
fetchLoading = _useState2[0],
|
|
3710
|
+
setFetchLoading = _useState2[1];
|
|
3711
|
+
var loadingOutput = /*#__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", {
|
|
3712
|
+
className: "cus-select-loader"
|
|
3713
|
+
}, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
3714
|
+
height: "12px",
|
|
3715
|
+
width: "12px",
|
|
3716
|
+
viewBox: "0 0 512 512"
|
|
3717
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3718
|
+
fill: "inherit",
|
|
3719
|
+
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"
|
|
3720
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3721
|
+
fill: "inherit",
|
|
3722
|
+
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"
|
|
3723
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3724
|
+
fill: "inherit",
|
|
3725
|
+
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"
|
|
3726
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3727
|
+
fill: "inherit",
|
|
3728
|
+
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"
|
|
3729
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3730
|
+
fill: "inherit",
|
|
3731
|
+
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"
|
|
3732
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3733
|
+
fill: "inherit",
|
|
3734
|
+
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"
|
|
3735
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3736
|
+
fill: "inherit",
|
|
3737
|
+
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"
|
|
3738
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
3739
|
+
fill: "inherit",
|
|
3740
|
+
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"
|
|
3741
|
+
})))));
|
|
3742
|
+
|
|
3706
3743
|
// return a array of options
|
|
3707
3744
|
var staticOptionsData = optionsRes;
|
|
3745
|
+
var hasDefaultOptions = staticOptionsData.length > 0;
|
|
3708
3746
|
|
|
3709
3747
|
//
|
|
3710
|
-
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(staticOptionsData),
|
|
3711
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
3712
|
-
orginalData = _useState2[0],
|
|
3713
|
-
setOrginalData = _useState2[1];
|
|
3714
3748
|
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(staticOptionsData),
|
|
3715
3749
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
3750
|
+
orginalData = _useState4[0],
|
|
3751
|
+
setOrginalData = _useState4[1];
|
|
3752
|
+
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(staticOptionsData),
|
|
3719
3753
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
3720
|
-
|
|
3721
|
-
|
|
3754
|
+
optionsData = _useState6[0],
|
|
3755
|
+
setOptionsData = _useState6[1];
|
|
3756
|
+
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3757
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3758
|
+
hasErr = _useState8[0],
|
|
3759
|
+
setHasErr = _useState8[1];
|
|
3722
3760
|
|
|
3723
3761
|
// Set the final result
|
|
3724
|
-
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
|
|
3725
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
3726
|
-
controlLabel = _useState8[0],
|
|
3727
|
-
setControlLabel = _useState8[1];
|
|
3728
3762
|
var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
|
|
3729
3763
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
3730
|
-
|
|
3731
|
-
|
|
3764
|
+
controlLabel = _useState10[0],
|
|
3765
|
+
setControlLabel = _useState10[1];
|
|
3766
|
+
var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
|
|
3767
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
3768
|
+
controlValue = _useState12[0],
|
|
3769
|
+
setControlValue = _useState12[1];
|
|
3732
3770
|
|
|
3733
3771
|
//
|
|
3734
|
-
var
|
|
3735
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
3736
|
-
controlTempValue = _useState12[0],
|
|
3737
|
-
setControlTempValue = _useState12[1]; // Storage for temporary input
|
|
3738
|
-
var _useState13 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3772
|
+
var _useState13 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
|
|
3739
3773
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
var _useState15 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
3774
|
+
controlTempValue = _useState14[0],
|
|
3775
|
+
setControlTempValue = _useState14[1]; // Storage for temporary input
|
|
3776
|
+
var _useState15 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3743
3777
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
var _useState17 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
3778
|
+
isOpen = _useState16[0],
|
|
3779
|
+
setIsOpen = _useState16[1];
|
|
3780
|
+
var _useState17 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
|
|
3747
3781
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
3748
|
-
|
|
3749
|
-
|
|
3782
|
+
incomingData = _useState18[0],
|
|
3783
|
+
setIncomingData = _useState18[1];
|
|
3750
3784
|
var _useState19 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3751
3785
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
3752
|
-
|
|
3753
|
-
|
|
3786
|
+
firstRequestExecuted = _useState20[0],
|
|
3787
|
+
setFirstRequestExecuted = _useState20[1];
|
|
3788
|
+
var _useState21 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3789
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
3790
|
+
handleFirstFetchCompleted = _useState22[0],
|
|
3791
|
+
setHandleFirstFetchCompleted = _useState22[1];
|
|
3754
3792
|
|
|
3755
3793
|
// Mark whether it is out of focus
|
|
3756
3794
|
// Fixed the issue that caused the pop-up window to still display due to
|
|
@@ -3758,25 +3796,25 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3758
3796
|
var isBlurringRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
3759
3797
|
|
|
3760
3798
|
// filter status
|
|
3761
|
-
var
|
|
3762
|
-
|
|
3763
|
-
filterItemsHasNoMatchData =
|
|
3764
|
-
setFilterItemsHasNoMatchData =
|
|
3799
|
+
var _useState23 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3800
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
3801
|
+
filterItemsHasNoMatchData = _useState24[0],
|
|
3802
|
+
setFilterItemsHasNoMatchData = _useState24[1];
|
|
3765
3803
|
|
|
3766
3804
|
// blinking cursor
|
|
3767
3805
|
var BLINKING_CURSOR_STR = '|';
|
|
3768
|
-
var
|
|
3769
|
-
|
|
3770
|
-
blinkingPosStart =
|
|
3771
|
-
setBlinkingPosStart =
|
|
3806
|
+
var _useState25 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
3807
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
3808
|
+
blinkingPosStart = _useState26[0],
|
|
3809
|
+
setBlinkingPosStart = _useState26[1];
|
|
3772
3810
|
var blinkingPosFauxRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3773
3811
|
var blinkingCursorPosDivRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3774
3812
|
|
|
3775
3813
|
// Select All status (for "Single selection")
|
|
3776
|
-
var
|
|
3777
|
-
|
|
3778
|
-
userInputboxIsAllSelected =
|
|
3779
|
-
setUserInputboxIsAllSelected =
|
|
3814
|
+
var _useState27 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
3815
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
3816
|
+
userInputboxIsAllSelected = _useState28[0],
|
|
3817
|
+
setUserInputboxIsAllSelected = _useState28[1];
|
|
3780
3818
|
var selectedSign = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
3781
3819
|
var MULTI_SEL_VALID = multiSelect ? multiSelect.valid : false;
|
|
3782
3820
|
var MULTI_SEL_ENTIRE_AREA_TRIGGER = typeof multiSelectEntireAreaTrigger === 'undefined' ? true : multiSelectEntireAreaTrigger;
|
|
@@ -3787,13 +3825,13 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3787
3825
|
allItemsLabel: 'All Content ({num})',
|
|
3788
3826
|
noneLabel: 'No items selected'
|
|
3789
3827
|
};
|
|
3790
|
-
var
|
|
3828
|
+
var _useState29 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
|
|
3791
3829
|
labels: [],
|
|
3792
3830
|
values: []
|
|
3793
3831
|
}),
|
|
3794
|
-
|
|
3795
|
-
controlArr =
|
|
3796
|
-
setControlArr =
|
|
3832
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
3833
|
+
controlArr = _useState30[0],
|
|
3834
|
+
setControlArr = _useState30[1];
|
|
3797
3835
|
|
|
3798
3836
|
// Only single symbols such as , #, and @ are allowed, and , a, a, , etc. are not allowed.
|
|
3799
3837
|
var isSingleSpecialChar = function isSingleSpecialChar(str) {
|
|
@@ -3943,6 +3981,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3943
3981
|
|
|
3944
3982
|
//performance
|
|
3945
3983
|
var handleChangeFetchSafe = useDebounce_default()(function (val) {
|
|
3984
|
+
setFetchLoading(true);
|
|
3946
3985
|
if (fetchUpdate) {
|
|
3947
3986
|
// update filter status
|
|
3948
3987
|
setFilterItemsHasNoMatchData(false);
|
|
@@ -3954,6 +3993,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3954
3993
|
popwinPosInit();
|
|
3955
3994
|
popwinFilterItems(val);
|
|
3956
3995
|
}, 0);
|
|
3996
|
+
setFetchLoading(false);
|
|
3957
3997
|
});
|
|
3958
3998
|
} else {
|
|
3959
3999
|
// pop win initalization
|
|
@@ -3961,6 +4001,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3961
4001
|
popwinPosInit();
|
|
3962
4002
|
popwinFilterItems(val);
|
|
3963
4003
|
}, 0);
|
|
4004
|
+
setFetchLoading(false);
|
|
3964
4005
|
}
|
|
3965
4006
|
}, 350, [optionsData]);
|
|
3966
4007
|
function fetchData(_x2, _x3, _x4) {
|
|
@@ -4517,10 +4558,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4517
4558
|
setIsOpen(false);
|
|
4518
4559
|
if (!MULTI_SEL_VALID) popwinPosHide();
|
|
4519
4560
|
if (MANUAL_REQ) {
|
|
4520
|
-
//
|
|
4521
|
-
setOptionsData(
|
|
4561
|
+
// restore to static data
|
|
4562
|
+
setOptionsData(staticOptionsData);
|
|
4522
4563
|
} else {
|
|
4523
|
-
// restore data
|
|
4524
4564
|
setOptionsData(orginalData);
|
|
4525
4565
|
}
|
|
4526
4566
|
|
|
@@ -4576,8 +4616,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4576
4616
|
}, 500);
|
|
4577
4617
|
}
|
|
4578
4618
|
if (MANUAL_REQ) {
|
|
4579
|
-
//
|
|
4580
|
-
setOptionsData(
|
|
4619
|
+
// display static data
|
|
4620
|
+
setOptionsData(staticOptionsData);
|
|
4581
4621
|
} else {
|
|
4582
4622
|
// restore data
|
|
4583
4623
|
setOptionsData(orginalData);
|
|
@@ -4589,7 +4629,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4589
4629
|
}
|
|
4590
4630
|
|
|
4591
4631
|
// Every time the input changes or the search button is clicked, a data request will be triggered
|
|
4592
|
-
|
|
4632
|
+
// !!! If the default data is empty, the pop-up window is not displayed
|
|
4633
|
+
if (MANUAL_REQ && (controlTempValue === '' || controlTempValue === null) && !hasDefaultOptions) {
|
|
4593
4634
|
setTimeout(function () {
|
|
4594
4635
|
popwinPosHide();
|
|
4595
4636
|
}, 0);
|
|
@@ -5098,18 +5139,21 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5098
5139
|
while (1) switch (_context6.prev = _context6.next) {
|
|
5099
5140
|
case 0:
|
|
5100
5141
|
inputVal = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;
|
|
5142
|
+
setFetchLoading(true);
|
|
5143
|
+
|
|
5101
5144
|
// data init
|
|
5102
5145
|
searchStr = typeof inputVal === 'string' ? inputVal : controlTempValue || controlTempValue === '' ? controlTempValue : '';
|
|
5103
5146
|
_oparams = fetchFuncMethodParams || [];
|
|
5104
5147
|
_params = _oparams.map(function (item) {
|
|
5105
5148
|
return item !== '$QUERY_STRING' ? item : searchStr;
|
|
5106
5149
|
});
|
|
5107
|
-
_context6.next =
|
|
5150
|
+
_context6.next = 7;
|
|
5108
5151
|
return fetchData(_params.join(','), '', '', false);
|
|
5109
|
-
case
|
|
5152
|
+
case 7:
|
|
5110
5153
|
res = _context6.sent;
|
|
5154
|
+
setFetchLoading(false);
|
|
5111
5155
|
return _context6.abrupt("return", res);
|
|
5112
|
-
case
|
|
5156
|
+
case 10:
|
|
5113
5157
|
case "end":
|
|
5114
5158
|
return _context6.stop();
|
|
5115
5159
|
}
|
|
@@ -5904,7 +5948,15 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5904
5948
|
__html: "".concat(CLEAR_TRIGGER_LABEL)
|
|
5905
5949
|
},
|
|
5906
5950
|
onClick: handleClearValue
|
|
5907
|
-
}))) : null) : null,
|
|
5951
|
+
}))) : null) : null, fetchLoading && MANUAL_REQ && hasDefaultOptions ?
|
|
5952
|
+
/*#__PURE__*/
|
|
5953
|
+
// only loading
|
|
5954
|
+
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("button", {
|
|
5955
|
+
tabIndex: -1,
|
|
5956
|
+
type: "button",
|
|
5957
|
+
className: "list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch",
|
|
5958
|
+
disabled: true
|
|
5959
|
+
}, loadingOutput)) : /*#__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("button", {
|
|
5908
5960
|
tabIndex: -1,
|
|
5909
5961
|
type: "button",
|
|
5910
5962
|
className: "list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch hide",
|
|
@@ -5913,37 +5965,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
5913
5965
|
// (1) Handling async data with the click event
|
|
5914
5966
|
!FIRST_REQUEST_AUTO && !handleFirstFetchCompleted ||
|
|
5915
5967
|
// (2) Every time the input changes or the search button is clicked, a data request will be triggered
|
|
5916
|
-
fetchUpdate && !filterItemsHasNoMatchData && controlTempValue !== '' ? /*#__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(
|
|
5917
|
-
className: "cus-select-loader"
|
|
5918
|
-
}, loader || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
5919
|
-
height: "12px",
|
|
5920
|
-
width: "12px",
|
|
5921
|
-
viewBox: "0 0 512 512"
|
|
5922
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5923
|
-
fill: "inherit",
|
|
5924
|
-
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"
|
|
5925
|
-
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5926
|
-
fill: "inherit",
|
|
5927
|
-
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"
|
|
5928
|
-
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5929
|
-
fill: "inherit",
|
|
5930
|
-
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"
|
|
5931
|
-
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5932
|
-
fill: "inherit",
|
|
5933
|
-
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"
|
|
5934
|
-
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5935
|
-
fill: "inherit",
|
|
5936
|
-
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"
|
|
5937
|
-
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5938
|
-
fill: "inherit",
|
|
5939
|
-
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"
|
|
5940
|
-
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5941
|
-
fill: "inherit",
|
|
5942
|
-
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"
|
|
5943
|
-
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
5944
|
-
fill: "inherit",
|
|
5945
|
-
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"
|
|
5946
|
-
}))))) : /*#__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) {
|
|
5968
|
+
fetchUpdate && !filterItemsHasNoMatchData && controlTempValue !== '' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, loadingOutput) : /*#__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) {
|
|
5947
5969
|
var startItemBorder = index === 0 ? 'border-top-0' : '';
|
|
5948
5970
|
var endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
|
|
5949
5971
|
|
|
@@ -6047,7 +6069,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
6047
6069
|
}
|
|
6048
6070
|
})));
|
|
6049
6071
|
}
|
|
6050
|
-
}) : null))))) : null));
|
|
6072
|
+
}) : null)))))) : null));
|
|
6051
6073
|
});
|
|
6052
6074
|
/* harmony default export */ const src = (Select);
|
|
6053
6075
|
})();
|
package/Table/index.js
CHANGED
|
@@ -1131,13 +1131,14 @@ var useTableKeyPress = function useTableKeyPress(_ref, deps) {
|
|
|
1131
1131
|
var handleKeyPressed = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)( /*#__PURE__*/function () {
|
|
1132
1132
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
1133
1133
|
var _focusableCellIdRef$c;
|
|
1134
|
-
var key, currentCell, row, col, nextCellSignal, oldCellSignal, _row, _col, move, _nextCellSignal;
|
|
1134
|
+
var key, isNumLockOn, currentCell, row, col, nextCellSignal, oldCellSignal, _row, _col, move, _nextCellSignal;
|
|
1135
1135
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1136
1136
|
while (1) switch (_context.prev = _context.next) {
|
|
1137
1137
|
case 0:
|
|
1138
|
-
key = event.code;
|
|
1138
|
+
key = event.code;
|
|
1139
|
+
isNumLockOn = event.getModifierState && event.getModifierState('NumLock'); // If Enter is pressed and keyboard navigation is disabled, just trigger onCellPressEnter
|
|
1139
1140
|
if (!((key === 'Enter' || key === 'NumpadEnter') && !enabled)) {
|
|
1140
|
-
_context.next =
|
|
1141
|
+
_context.next = 9;
|
|
1141
1142
|
break;
|
|
1142
1143
|
}
|
|
1143
1144
|
currentCell = event.target;
|
|
@@ -1146,13 +1147,13 @@ var useTableKeyPress = function useTableKeyPress(_ref, deps) {
|
|
|
1146
1147
|
nextCellSignal = cellMark(row, col);
|
|
1147
1148
|
onCellPressEnter === null || onCellPressEnter === void 0 ? void 0 : onCellPressEnter(nextCellSignal, refNode.current.get(nextCellSignal), event);
|
|
1148
1149
|
return _context.abrupt("return");
|
|
1149
|
-
case
|
|
1150
|
+
case 9:
|
|
1150
1151
|
if (!(!Array.isArray(data) || rootDataInfo === null || spyElement === null || typeof enabled === 'undefined' || enabled === false)) {
|
|
1151
|
-
_context.next =
|
|
1152
|
+
_context.next = 11;
|
|
1152
1153
|
break;
|
|
1153
1154
|
}
|
|
1154
1155
|
return _context.abrupt("return");
|
|
1155
|
-
case
|
|
1156
|
+
case 11:
|
|
1156
1157
|
// Parse the current focused cell's row and column
|
|
1157
1158
|
oldCellSignal = (_focusableCellIdRef$c = focusableCellIdRef.current) === null || _focusableCellIdRef$c === void 0 ? void 0 : _focusableCellIdRef$c.replace('cell-', '').split('-');
|
|
1158
1159
|
_row = Number(oldCellSignal[0]);
|
|
@@ -1171,45 +1172,39 @@ var useTableKeyPress = function useTableKeyPress(_ref, deps) {
|
|
|
1171
1172
|
maxCol = rowInfo.colCount;
|
|
1172
1173
|
}
|
|
1173
1174
|
}
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
isBottomEdge = true;
|
|
1208
|
-
_row = rootDataInfo.totalRow - 1;
|
|
1209
|
-
} else {
|
|
1210
|
-
_row = _row + 1;
|
|
1211
|
-
}
|
|
1212
|
-
break;
|
|
1175
|
+
|
|
1176
|
+
// Numpad2/4/6/8 trigger direction is allowed only when NumLock is off
|
|
1177
|
+
if (key === 'ArrowLeft' || key === 'Numpad4' && !isNumLockOn) {
|
|
1178
|
+
if (_col - 1 < 0) {
|
|
1179
|
+
isLeftEdge = true;
|
|
1180
|
+
_col = 0;
|
|
1181
|
+
} else {
|
|
1182
|
+
_col = _col - 1;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
if (key === 'ArrowRight' || key === 'Numpad6' && !isNumLockOn) {
|
|
1186
|
+
if (_col + 1 > maxCol - 1) {
|
|
1187
|
+
isRightEdge = true;
|
|
1188
|
+
_col = maxCol - 1;
|
|
1189
|
+
} else {
|
|
1190
|
+
_col = _col + 1;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
if (key === 'ArrowUp' || key === 'Numpad8' && !isNumLockOn) {
|
|
1194
|
+
if (_row - 1 < 0) {
|
|
1195
|
+
isTopEdge = true;
|
|
1196
|
+
_row = 0;
|
|
1197
|
+
} else {
|
|
1198
|
+
_row = _row - 1;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
if (key === 'ArrowDown' || key === 'Numpad2' && !isNumLockOn) {
|
|
1202
|
+
if (_row + 1 > rootDataInfo.totalRow - 1) {
|
|
1203
|
+
isBottomEdge = true;
|
|
1204
|
+
_row = rootDataInfo.totalRow - 1;
|
|
1205
|
+
} else {
|
|
1206
|
+
_row = _row + 1;
|
|
1207
|
+
}
|
|
1213
1208
|
}
|
|
1214
1209
|
var nextCellSignal = cellMark(_row, _col);
|
|
1215
1210
|
// Focus the current cell
|
|
@@ -1223,16 +1218,17 @@ var useTableKeyPress = function useTableKeyPress(_ref, deps) {
|
|
|
1223
1218
|
onCellKeyPressed === null || onCellKeyPressed === void 0 ? void 0 : onCellKeyPressed(nextCellSignal, refNode.current.get(nextCellSignal), event, isLeftEdge, isRightEdge, isTopEdge, isBottomEdge);
|
|
1224
1219
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
1225
1220
|
}; // Handle arrow key navigation
|
|
1226
|
-
|
|
1221
|
+
// Numpad2/4/6/8 trigger direction is allowed only when NumLock is off
|
|
1222
|
+
if (key === 'ArrowLeft' || key === 'Numpad4' && !isNumLockOn) {
|
|
1227
1223
|
move('ArrowLeft');
|
|
1228
1224
|
}
|
|
1229
|
-
if (key === 'ArrowRight' || key === 'Numpad6') {
|
|
1225
|
+
if (key === 'ArrowRight' || key === 'Numpad6' && !isNumLockOn) {
|
|
1230
1226
|
move('ArrowRight');
|
|
1231
1227
|
}
|
|
1232
|
-
if (key === 'ArrowUp' || key === 'Numpad8') {
|
|
1228
|
+
if (key === 'ArrowUp' || key === 'Numpad8' && !isNumLockOn) {
|
|
1233
1229
|
move('ArrowUp');
|
|
1234
1230
|
}
|
|
1235
|
-
if (key === 'ArrowDown' || key === 'Numpad2') {
|
|
1231
|
+
if (key === 'ArrowDown' || key === 'Numpad2' && !isNumLockOn) {
|
|
1236
1232
|
move('ArrowDown');
|
|
1237
1233
|
}
|
|
1238
1234
|
|
|
@@ -1241,7 +1237,7 @@ var useTableKeyPress = function useTableKeyPress(_ref, deps) {
|
|
|
1241
1237
|
_nextCellSignal = cellMark(_row, _col);
|
|
1242
1238
|
onCellPressEnter === null || onCellPressEnter === void 0 ? void 0 : onCellPressEnter(_nextCellSignal, refNode.current.get(_nextCellSignal), event);
|
|
1243
1239
|
}
|
|
1244
|
-
case
|
|
1240
|
+
case 20:
|
|
1245
1241
|
case "end":
|
|
1246
1242
|
return _context.stop();
|
|
1247
1243
|
}
|
package/lib/cjs/Date/index.js
CHANGED
|
@@ -5471,14 +5471,16 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
5471
5471
|
}
|
|
5472
5472
|
function _handleKeyPressedForSplitInputs() {
|
|
5473
5473
|
_handleKeyPressedForSplitInputs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
5474
|
-
var key, btnMark, isLeftArrow, isRightArrow, move;
|
|
5474
|
+
var key, btnMark, isNumLockOn, isLeftArrow, isRightArrow, move;
|
|
5475
5475
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
5476
5476
|
while (1) switch (_context2.prev = _context2.next) {
|
|
5477
5477
|
case 0:
|
|
5478
5478
|
key = event.code;
|
|
5479
|
-
btnMark = event.target.dataset.mark;
|
|
5480
|
-
|
|
5481
|
-
|
|
5479
|
+
btnMark = event.target.dataset.mark;
|
|
5480
|
+
isNumLockOn = event.getModifierState && event.getModifierState('NumLock'); // Check for both regular arrow keys and numpad arrow keys
|
|
5481
|
+
// Numpad2/4/6/8 trigger direction is allowed only when NumLock is off
|
|
5482
|
+
isLeftArrow = key === 'ArrowLeft' || key === 'Numpad4' && !isNumLockOn;
|
|
5483
|
+
isRightArrow = key === 'ArrowRight' || key === 'Numpad6' && !isNumLockOn;
|
|
5482
5484
|
move = function move(direction) {
|
|
5483
5485
|
var currentIndex = splitInputsIds.findIndex(function (s) {
|
|
5484
5486
|
return s === btnMark;
|
|
@@ -5499,7 +5501,7 @@ var src_Date = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
|
|
|
5499
5501
|
if (isRightArrow) {
|
|
5500
5502
|
move('right');
|
|
5501
5503
|
}
|
|
5502
|
-
case
|
|
5504
|
+
case 8:
|
|
5503
5505
|
case "end":
|
|
5504
5506
|
return _context2.stop();
|
|
5505
5507
|
}
|