downshift 6.1.10 → 6.1.12
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/dist/downshift.cjs.js +17 -11
- package/dist/downshift.esm.js +17 -11
- package/dist/downshift.native.cjs.js +17 -11
- package/dist/downshift.umd.js +17 -11
- package/dist/downshift.umd.js.map +1 -1
- package/dist/downshift.umd.min.js +1 -1
- package/dist/downshift.umd.min.js.map +1 -1
- package/package.json +2 -1
- package/preact/dist/downshift.cjs.js +17 -11
- package/preact/dist/downshift.esm.js +17 -11
- package/preact/dist/downshift.umd.js +17 -11
- package/preact/dist/downshift.umd.js.map +1 -1
- package/preact/dist/downshift.umd.min.js +1 -1
- package/preact/dist/downshift.umd.min.js.map +1 -1
package/dist/downshift.cjs.js
CHANGED
|
@@ -2204,7 +2204,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
|
|
|
2204
2204
|
switch (type) {
|
|
2205
2205
|
case stateChangeTypes.ItemMouseMove:
|
|
2206
2206
|
changes = {
|
|
2207
|
-
highlightedIndex: action.index
|
|
2207
|
+
highlightedIndex: action.disabled ? -1 : action.index
|
|
2208
2208
|
};
|
|
2209
2209
|
break;
|
|
2210
2210
|
|
|
@@ -2953,6 +2953,7 @@ function useSelect(userProps) {
|
|
|
2953
2953
|
onClick,
|
|
2954
2954
|
refKey = 'ref',
|
|
2955
2955
|
ref,
|
|
2956
|
+
disabled,
|
|
2956
2957
|
...rest
|
|
2957
2958
|
} = _temp5 === void 0 ? {} : _temp5;
|
|
2958
2959
|
const {
|
|
@@ -2968,7 +2969,8 @@ function useSelect(userProps) {
|
|
|
2968
2969
|
shouldScrollRef.current = false;
|
|
2969
2970
|
dispatch({
|
|
2970
2971
|
type: ItemMouseMove$1,
|
|
2971
|
-
index
|
|
2972
|
+
index,
|
|
2973
|
+
disabled
|
|
2972
2974
|
});
|
|
2973
2975
|
};
|
|
2974
2976
|
|
|
@@ -2986,6 +2988,7 @@ function useSelect(userProps) {
|
|
|
2986
2988
|
}
|
|
2987
2989
|
|
|
2988
2990
|
const itemProps = {
|
|
2991
|
+
disabled,
|
|
2989
2992
|
role: 'option',
|
|
2990
2993
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
2991
2994
|
id: elementIds.getItemId(itemIndex),
|
|
@@ -2997,11 +3000,11 @@ function useSelect(userProps) {
|
|
|
2997
3000
|
...rest
|
|
2998
3001
|
};
|
|
2999
3002
|
|
|
3000
|
-
if (!
|
|
3001
|
-
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
3003
|
+
if (!disabled) {
|
|
3002
3004
|
itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
|
|
3003
3005
|
}
|
|
3004
3006
|
|
|
3007
|
+
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
3005
3008
|
return itemProps;
|
|
3006
3009
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|
|
3007
3010
|
return {
|
|
@@ -3526,8 +3529,10 @@ function useCombobox(userProps) {
|
|
|
3526
3529
|
refKey = 'ref',
|
|
3527
3530
|
ref,
|
|
3528
3531
|
onMouseMove,
|
|
3532
|
+
onMouseDown,
|
|
3529
3533
|
onClick,
|
|
3530
3534
|
onPress,
|
|
3535
|
+
disabled,
|
|
3531
3536
|
...rest
|
|
3532
3537
|
} = _temp3 === void 0 ? {} : _temp3;
|
|
3533
3538
|
const {
|
|
@@ -3551,7 +3556,8 @@ function useCombobox(userProps) {
|
|
|
3551
3556
|
shouldScrollRef.current = false;
|
|
3552
3557
|
dispatch({
|
|
3553
3558
|
type: ItemMouseMove,
|
|
3554
|
-
index
|
|
3559
|
+
index,
|
|
3560
|
+
disabled
|
|
3555
3561
|
});
|
|
3556
3562
|
};
|
|
3557
3563
|
|
|
@@ -3560,25 +3566,25 @@ function useCombobox(userProps) {
|
|
|
3560
3566
|
type: ItemClick,
|
|
3561
3567
|
index
|
|
3562
3568
|
});
|
|
3563
|
-
|
|
3564
|
-
if (inputRef.current) {
|
|
3565
|
-
inputRef.current.focus();
|
|
3566
|
-
}
|
|
3567
3569
|
};
|
|
3568
3570
|
|
|
3571
|
+
const itemHandleMouseDown = e => e.preventDefault();
|
|
3572
|
+
|
|
3569
3573
|
return {
|
|
3570
3574
|
[refKey]: handleRefs(ref, itemNode => {
|
|
3571
3575
|
if (itemNode) {
|
|
3572
3576
|
itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
|
|
3573
3577
|
}
|
|
3574
3578
|
}),
|
|
3579
|
+
disabled,
|
|
3575
3580
|
role: 'option',
|
|
3576
3581
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
3577
3582
|
id: elementIds.getItemId(itemIndex),
|
|
3578
|
-
...(!
|
|
3579
|
-
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
3583
|
+
...(!disabled && {
|
|
3580
3584
|
[onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
|
|
3581
3585
|
}),
|
|
3586
|
+
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
3587
|
+
onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown),
|
|
3582
3588
|
...rest
|
|
3583
3589
|
};
|
|
3584
3590
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|
package/dist/downshift.esm.js
CHANGED
|
@@ -2195,7 +2195,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
|
|
|
2195
2195
|
switch (type) {
|
|
2196
2196
|
case stateChangeTypes.ItemMouseMove:
|
|
2197
2197
|
changes = {
|
|
2198
|
-
highlightedIndex: action.index
|
|
2198
|
+
highlightedIndex: action.disabled ? -1 : action.index
|
|
2199
2199
|
};
|
|
2200
2200
|
break;
|
|
2201
2201
|
|
|
@@ -2944,6 +2944,7 @@ function useSelect(userProps) {
|
|
|
2944
2944
|
onClick,
|
|
2945
2945
|
refKey = 'ref',
|
|
2946
2946
|
ref,
|
|
2947
|
+
disabled,
|
|
2947
2948
|
...rest
|
|
2948
2949
|
} = _temp5 === void 0 ? {} : _temp5;
|
|
2949
2950
|
const {
|
|
@@ -2959,7 +2960,8 @@ function useSelect(userProps) {
|
|
|
2959
2960
|
shouldScrollRef.current = false;
|
|
2960
2961
|
dispatch({
|
|
2961
2962
|
type: ItemMouseMove$1,
|
|
2962
|
-
index
|
|
2963
|
+
index,
|
|
2964
|
+
disabled
|
|
2963
2965
|
});
|
|
2964
2966
|
};
|
|
2965
2967
|
|
|
@@ -2977,6 +2979,7 @@ function useSelect(userProps) {
|
|
|
2977
2979
|
}
|
|
2978
2980
|
|
|
2979
2981
|
const itemProps = {
|
|
2982
|
+
disabled,
|
|
2980
2983
|
role: 'option',
|
|
2981
2984
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
2982
2985
|
id: elementIds.getItemId(itemIndex),
|
|
@@ -2988,11 +2991,11 @@ function useSelect(userProps) {
|
|
|
2988
2991
|
...rest
|
|
2989
2992
|
};
|
|
2990
2993
|
|
|
2991
|
-
if (!
|
|
2992
|
-
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
2994
|
+
if (!disabled) {
|
|
2993
2995
|
itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
|
|
2994
2996
|
}
|
|
2995
2997
|
|
|
2998
|
+
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
2996
2999
|
return itemProps;
|
|
2997
3000
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|
|
2998
3001
|
return {
|
|
@@ -3517,8 +3520,10 @@ function useCombobox(userProps) {
|
|
|
3517
3520
|
refKey = 'ref',
|
|
3518
3521
|
ref,
|
|
3519
3522
|
onMouseMove,
|
|
3523
|
+
onMouseDown,
|
|
3520
3524
|
onClick,
|
|
3521
3525
|
onPress,
|
|
3526
|
+
disabled,
|
|
3522
3527
|
...rest
|
|
3523
3528
|
} = _temp3 === void 0 ? {} : _temp3;
|
|
3524
3529
|
const {
|
|
@@ -3542,7 +3547,8 @@ function useCombobox(userProps) {
|
|
|
3542
3547
|
shouldScrollRef.current = false;
|
|
3543
3548
|
dispatch({
|
|
3544
3549
|
type: ItemMouseMove,
|
|
3545
|
-
index
|
|
3550
|
+
index,
|
|
3551
|
+
disabled
|
|
3546
3552
|
});
|
|
3547
3553
|
};
|
|
3548
3554
|
|
|
@@ -3551,25 +3557,25 @@ function useCombobox(userProps) {
|
|
|
3551
3557
|
type: ItemClick,
|
|
3552
3558
|
index
|
|
3553
3559
|
});
|
|
3554
|
-
|
|
3555
|
-
if (inputRef.current) {
|
|
3556
|
-
inputRef.current.focus();
|
|
3557
|
-
}
|
|
3558
3560
|
};
|
|
3559
3561
|
|
|
3562
|
+
const itemHandleMouseDown = e => e.preventDefault();
|
|
3563
|
+
|
|
3560
3564
|
return {
|
|
3561
3565
|
[refKey]: handleRefs(ref, itemNode => {
|
|
3562
3566
|
if (itemNode) {
|
|
3563
3567
|
itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
|
|
3564
3568
|
}
|
|
3565
3569
|
}),
|
|
3570
|
+
disabled,
|
|
3566
3571
|
role: 'option',
|
|
3567
3572
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
3568
3573
|
id: elementIds.getItemId(itemIndex),
|
|
3569
|
-
...(!
|
|
3570
|
-
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
3574
|
+
...(!disabled && {
|
|
3571
3575
|
[onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
|
|
3572
3576
|
}),
|
|
3577
|
+
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
3578
|
+
onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown),
|
|
3573
3579
|
...rest
|
|
3574
3580
|
};
|
|
3575
3581
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|
|
@@ -2135,7 +2135,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
|
|
|
2135
2135
|
switch (type) {
|
|
2136
2136
|
case stateChangeTypes.ItemMouseMove:
|
|
2137
2137
|
changes = {
|
|
2138
|
-
highlightedIndex: action.index
|
|
2138
|
+
highlightedIndex: action.disabled ? -1 : action.index
|
|
2139
2139
|
};
|
|
2140
2140
|
break;
|
|
2141
2141
|
|
|
@@ -2884,6 +2884,7 @@ function useSelect(userProps) {
|
|
|
2884
2884
|
onClick,
|
|
2885
2885
|
refKey = 'ref',
|
|
2886
2886
|
ref,
|
|
2887
|
+
disabled,
|
|
2887
2888
|
...rest
|
|
2888
2889
|
} = _temp5 === void 0 ? {} : _temp5;
|
|
2889
2890
|
const {
|
|
@@ -2899,7 +2900,8 @@ function useSelect(userProps) {
|
|
|
2899
2900
|
shouldScrollRef.current = false;
|
|
2900
2901
|
dispatch({
|
|
2901
2902
|
type: ItemMouseMove$1,
|
|
2902
|
-
index
|
|
2903
|
+
index,
|
|
2904
|
+
disabled
|
|
2903
2905
|
});
|
|
2904
2906
|
};
|
|
2905
2907
|
|
|
@@ -2917,6 +2919,7 @@ function useSelect(userProps) {
|
|
|
2917
2919
|
}
|
|
2918
2920
|
|
|
2919
2921
|
const itemProps = {
|
|
2922
|
+
disabled,
|
|
2920
2923
|
role: 'option',
|
|
2921
2924
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
2922
2925
|
id: elementIds.getItemId(itemIndex),
|
|
@@ -2928,11 +2931,11 @@ function useSelect(userProps) {
|
|
|
2928
2931
|
...rest
|
|
2929
2932
|
};
|
|
2930
2933
|
|
|
2931
|
-
if (!
|
|
2932
|
-
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
2934
|
+
if (!disabled) {
|
|
2933
2935
|
itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
|
|
2934
2936
|
}
|
|
2935
2937
|
|
|
2938
|
+
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
2936
2939
|
return itemProps;
|
|
2937
2940
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|
|
2938
2941
|
return {
|
|
@@ -3457,8 +3460,10 @@ function useCombobox(userProps) {
|
|
|
3457
3460
|
refKey = 'ref',
|
|
3458
3461
|
ref,
|
|
3459
3462
|
onMouseMove,
|
|
3463
|
+
onMouseDown,
|
|
3460
3464
|
onClick,
|
|
3461
3465
|
onPress,
|
|
3466
|
+
disabled,
|
|
3462
3467
|
...rest
|
|
3463
3468
|
} = _temp3 === void 0 ? {} : _temp3;
|
|
3464
3469
|
const {
|
|
@@ -3484,7 +3489,8 @@ function useCombobox(userProps) {
|
|
|
3484
3489
|
shouldScrollRef.current = false;
|
|
3485
3490
|
dispatch({
|
|
3486
3491
|
type: ItemMouseMove,
|
|
3487
|
-
index
|
|
3492
|
+
index,
|
|
3493
|
+
disabled
|
|
3488
3494
|
});
|
|
3489
3495
|
};
|
|
3490
3496
|
|
|
@@ -3493,25 +3499,25 @@ function useCombobox(userProps) {
|
|
|
3493
3499
|
type: ItemClick,
|
|
3494
3500
|
index
|
|
3495
3501
|
});
|
|
3496
|
-
|
|
3497
|
-
if (inputRef.current) {
|
|
3498
|
-
inputRef.current.focus();
|
|
3499
|
-
}
|
|
3500
3502
|
};
|
|
3501
3503
|
|
|
3504
|
+
const itemHandleMouseDown = e => e.preventDefault();
|
|
3505
|
+
|
|
3502
3506
|
return {
|
|
3503
3507
|
[refKey]: handleRefs(ref, itemNode => {
|
|
3504
3508
|
if (itemNode) {
|
|
3505
3509
|
itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
|
|
3506
3510
|
}
|
|
3507
3511
|
}),
|
|
3512
|
+
disabled,
|
|
3508
3513
|
role: 'option',
|
|
3509
3514
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
3510
3515
|
id: elementIds.getItemId(itemIndex),
|
|
3511
|
-
...(!
|
|
3512
|
-
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
3516
|
+
...(!disabled && {
|
|
3513
3517
|
[onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
|
|
3514
3518
|
}),
|
|
3519
|
+
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
3520
|
+
onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown),
|
|
3515
3521
|
...rest
|
|
3516
3522
|
};
|
|
3517
3523
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|
package/dist/downshift.umd.js
CHANGED
|
@@ -3446,7 +3446,7 @@
|
|
|
3446
3446
|
switch (type) {
|
|
3447
3447
|
case stateChangeTypes.ItemMouseMove:
|
|
3448
3448
|
changes = {
|
|
3449
|
-
highlightedIndex: action.index
|
|
3449
|
+
highlightedIndex: action.disabled ? -1 : action.index
|
|
3450
3450
|
};
|
|
3451
3451
|
break;
|
|
3452
3452
|
|
|
@@ -4221,6 +4221,7 @@
|
|
|
4221
4221
|
onClick,
|
|
4222
4222
|
refKey = 'ref',
|
|
4223
4223
|
ref,
|
|
4224
|
+
disabled,
|
|
4224
4225
|
...rest
|
|
4225
4226
|
} = _temp5 === void 0 ? {} : _temp5;
|
|
4226
4227
|
const {
|
|
@@ -4236,7 +4237,8 @@
|
|
|
4236
4237
|
shouldScrollRef.current = false;
|
|
4237
4238
|
dispatch({
|
|
4238
4239
|
type: ItemMouseMove$1,
|
|
4239
|
-
index
|
|
4240
|
+
index,
|
|
4241
|
+
disabled
|
|
4240
4242
|
});
|
|
4241
4243
|
};
|
|
4242
4244
|
|
|
@@ -4254,6 +4256,7 @@
|
|
|
4254
4256
|
}
|
|
4255
4257
|
|
|
4256
4258
|
const itemProps = {
|
|
4259
|
+
disabled,
|
|
4257
4260
|
role: 'option',
|
|
4258
4261
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
4259
4262
|
id: elementIds.getItemId(itemIndex),
|
|
@@ -4265,11 +4268,11 @@
|
|
|
4265
4268
|
...rest
|
|
4266
4269
|
};
|
|
4267
4270
|
|
|
4268
|
-
if (!
|
|
4269
|
-
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
4271
|
+
if (!disabled) {
|
|
4270
4272
|
itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
|
|
4271
4273
|
}
|
|
4272
4274
|
|
|
4275
|
+
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
|
|
4273
4276
|
return itemProps;
|
|
4274
4277
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|
|
4275
4278
|
return {
|
|
@@ -4794,8 +4797,10 @@
|
|
|
4794
4797
|
refKey = 'ref',
|
|
4795
4798
|
ref,
|
|
4796
4799
|
onMouseMove,
|
|
4800
|
+
onMouseDown,
|
|
4797
4801
|
onClick,
|
|
4798
4802
|
onPress,
|
|
4803
|
+
disabled,
|
|
4799
4804
|
...rest
|
|
4800
4805
|
} = _temp3 === void 0 ? {} : _temp3;
|
|
4801
4806
|
const {
|
|
@@ -4819,7 +4824,8 @@
|
|
|
4819
4824
|
shouldScrollRef.current = false;
|
|
4820
4825
|
dispatch({
|
|
4821
4826
|
type: ItemMouseMove,
|
|
4822
|
-
index
|
|
4827
|
+
index,
|
|
4828
|
+
disabled
|
|
4823
4829
|
});
|
|
4824
4830
|
};
|
|
4825
4831
|
|
|
@@ -4828,25 +4834,25 @@
|
|
|
4828
4834
|
type: ItemClick,
|
|
4829
4835
|
index
|
|
4830
4836
|
});
|
|
4831
|
-
|
|
4832
|
-
if (inputRef.current) {
|
|
4833
|
-
inputRef.current.focus();
|
|
4834
|
-
}
|
|
4835
4837
|
};
|
|
4836
4838
|
|
|
4839
|
+
const itemHandleMouseDown = e => e.preventDefault();
|
|
4840
|
+
|
|
4837
4841
|
return {
|
|
4838
4842
|
[refKey]: handleRefs(ref, itemNode => {
|
|
4839
4843
|
if (itemNode) {
|
|
4840
4844
|
itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
|
|
4841
4845
|
}
|
|
4842
4846
|
}),
|
|
4847
|
+
disabled,
|
|
4843
4848
|
role: 'option',
|
|
4844
4849
|
'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
|
|
4845
4850
|
id: elementIds.getItemId(itemIndex),
|
|
4846
|
-
...(!
|
|
4847
|
-
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
4851
|
+
...(!disabled && {
|
|
4848
4852
|
[onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)
|
|
4849
4853
|
}),
|
|
4854
|
+
onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
|
|
4855
|
+
onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown),
|
|
4850
4856
|
...rest
|
|
4851
4857
|
};
|
|
4852
4858
|
}, [dispatch, latest, shouldScrollRef, elementIds]);
|