primereact 10.4.0 → 10.5.0
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/calendar/calendar.cjs.js +12 -4
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +12 -4
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +12 -4
- package/calendar/calendar.min.js +1 -1
- package/checkbox/checkbox.cjs.js +2 -0
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +2 -0
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +2 -0
- package/checkbox/checkbox.min.js +1 -1
- package/chips/chips.cjs.js +109 -20
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +109 -20
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +109 -20
- package/chips/chips.min.js +1 -1
- package/core/core.js +643 -465
- package/core/core.min.js +4 -4
- package/dropdown/dropdown.cjs.js +313 -141
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +313 -141
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +313 -141
- package/dropdown/dropdown.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +21 -17
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +21 -17
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +21 -17
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +3 -1
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +3 -1
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +3 -1
- package/inputswitch/inputswitch.min.js +1 -1
- package/knob/knob.cjs.js +62 -0
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +62 -0
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +62 -0
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +362 -92
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +363 -93
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +362 -92
- package/listbox/listbox.min.js +1 -1
- package/menu/menu.cjs.js +4 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +4 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +5 -4
- package/menu/menu.min.js +1 -1
- package/multiselect/multiselect.cjs.js +377 -107
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +377 -107
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +377 -107
- package/multiselect/multiselect.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +251 -251
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +258 -258
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +251 -251
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +2 -1
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +2 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +3 -3
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +3 -2
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +3 -2
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +3 -2
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +22 -20
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +22 -20
- package/password/password.esm.min.js +1 -1
- package/password/password.js +22 -20
- package/password/password.min.js +1 -1
- package/primereact.all.cjs.js +1473 -485
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1473 -485
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1473 -485
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +1 -0
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +1 -0
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +1 -0
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +103 -4
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +103 -4
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +103 -4
- package/rating/rating.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +328 -67
- package/resources/themes/arya-green/theme.css +328 -67
- package/resources/themes/arya-orange/theme.css +328 -67
- package/resources/themes/arya-purple/theme.css +26 -6
- package/resources/themes/bootstrap4-dark-blue/theme.css +328 -67
- package/resources/themes/bootstrap4-dark-purple/theme.css +26 -6
- package/resources/themes/bootstrap4-light-blue/theme.css +328 -67
- package/resources/themes/bootstrap4-light-purple/theme.css +26 -6
- package/resources/themes/fluent-light/theme.css +327 -66
- package/resources/themes/lara-dark-amber/theme.css +328 -67
- package/resources/themes/lara-dark-blue/theme.css +328 -67
- package/resources/themes/lara-dark-cyan/theme.css +328 -67
- package/resources/themes/lara-dark-green/theme.css +328 -67
- package/resources/themes/lara-dark-indigo/theme.css +328 -67
- package/resources/themes/lara-dark-pink/theme.css +328 -67
- package/resources/themes/lara-dark-purple/theme.css +26 -6
- package/resources/themes/lara-dark-teal/theme.css +328 -67
- package/resources/themes/lara-light-amber/theme.css +328 -67
- package/resources/themes/lara-light-blue/theme.css +328 -67
- package/resources/themes/lara-light-cyan/theme.css +328 -67
- package/resources/themes/lara-light-green/theme.css +328 -67
- package/resources/themes/lara-light-indigo/theme.css +328 -67
- package/resources/themes/lara-light-pink/theme.css +328 -67
- package/resources/themes/lara-light-purple/theme.css +26 -6
- package/resources/themes/lara-light-teal/theme.css +328 -67
- package/resources/themes/luna-amber/theme.css +328 -67
- package/resources/themes/luna-blue/theme.css +328 -67
- package/resources/themes/luna-green/theme.css +328 -67
- package/resources/themes/luna-pink/theme.css +328 -67
- package/resources/themes/md-dark-deeppurple/theme.css +158 -138
- package/resources/themes/md-dark-indigo/theme.css +454 -193
- package/resources/themes/md-light-deeppurple/theme.css +26 -6
- package/resources/themes/md-light-indigo/theme.css +328 -67
- package/resources/themes/mdc-dark-deeppurple/theme.css +158 -138
- package/resources/themes/mdc-dark-indigo/theme.css +454 -193
- package/resources/themes/mdc-light-deeppurple/theme.css +26 -6
- package/resources/themes/mdc-light-indigo/theme.css +328 -67
- package/resources/themes/mira/theme.css +328 -67
- package/resources/themes/nano/theme.css +328 -67
- package/resources/themes/nova/theme.css +328 -67
- package/resources/themes/nova-accent/theme.css +328 -67
- package/resources/themes/nova-alt/theme.css +328 -67
- package/resources/themes/rhea/theme.css +328 -67
- package/resources/themes/saga-blue/theme.css +328 -67
- package/resources/themes/saga-green/theme.css +328 -67
- package/resources/themes/saga-orange/theme.css +328 -67
- package/resources/themes/saga-purple/theme.css +26 -6
- package/resources/themes/soho-dark/theme.css +353 -92
- package/resources/themes/soho-light/theme.css +328 -67
- package/resources/themes/tailwind-light/theme.css +329 -71
- package/resources/themes/vela-blue/theme.css +328 -67
- package/resources/themes/vela-green/theme.css +328 -67
- package/resources/themes/vela-orange/theme.css +328 -67
- package/resources/themes/vela-purple/theme.css +26 -6
- package/resources/themes/viva-dark/theme.css +328 -67
- package/resources/themes/viva-light/theme.css +328 -67
- package/selectbutton/selectbutton.cjs.js +96 -50
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +96 -50
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +96 -50
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/slider.cjs.js +25 -4
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +25 -4
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +25 -4
- package/slider/slider.min.js +1 -1
- package/splitter/splitter.cjs.js +16 -15
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +16 -15
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +16 -15
- package/splitter/splitter.min.js +1 -1
- package/tabview/tabview.cjs.js +6 -5
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +39 -34
- package/tabview/tabview.esm.js +6 -5
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +6 -5
- package/tabview/tabview.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +15 -14
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +14 -13
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +15 -14
- package/togglebutton/togglebutton.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +3 -2
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +3 -2
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +3 -2
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/web-types.json +1 -1
package/primereact.all.esm.js
CHANGED
|
@@ -2916,7 +2916,7 @@ function localeOption(key, locale) {
|
|
|
2916
2916
|
* @param {any} options JSON options like { page: 2, user: "John", role: "Admin" }
|
|
2917
2917
|
* @returns the ARIA label with replaced values
|
|
2918
2918
|
*/
|
|
2919
|
-
function ariaLabel
|
|
2919
|
+
function ariaLabel(ariaKey, options) {
|
|
2920
2920
|
var _locale = PrimeReact$1.locale;
|
|
2921
2921
|
try {
|
|
2922
2922
|
var _ariaLabel = localeOptions(_locale)['aria'][ariaKey];
|
|
@@ -11815,11 +11815,14 @@ var Calendar = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
11815
11815
|
}
|
|
11816
11816
|
if (props.view === 'date') {
|
|
11817
11817
|
overlayRef.current.style.width = DomHandler.getOuterWidth(overlayRef.current) + 'px';
|
|
11818
|
-
overlayRef.current.style.minWidth = inputWidth + 'px';
|
|
11819
11818
|
} else {
|
|
11820
|
-
overlayRef.current.style.minWidth = inputWidth + 'px';
|
|
11821
11819
|
overlayRef.current.style.width = inputWidth + 'px';
|
|
11822
11820
|
}
|
|
11821
|
+
|
|
11822
|
+
// #5830 Tailwind does not need a min width it breaks the styling
|
|
11823
|
+
if (!isUnstyled()) {
|
|
11824
|
+
overlayRef.current.style.minWidth = inputWidth + 'px';
|
|
11825
|
+
}
|
|
11823
11826
|
}
|
|
11824
11827
|
alignOverlay();
|
|
11825
11828
|
};
|
|
@@ -11870,7 +11873,7 @@ var Calendar = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
11870
11873
|
if (isUnstyled) {
|
|
11871
11874
|
destroyMask();
|
|
11872
11875
|
} else {
|
|
11873
|
-
DomHandler.addClass(touchUIMask.current, 'p-component-overlay-leave');
|
|
11876
|
+
!isUnstyled() && DomHandler.addClass(touchUIMask.current, 'p-component-overlay-leave');
|
|
11874
11877
|
touchUIMask.current.addEventListener('animationend', function () {
|
|
11875
11878
|
destroyMask();
|
|
11876
11879
|
});
|
|
@@ -12250,7 +12253,12 @@ var Calendar = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
12250
12253
|
var isEnabled = props.enabledDates.some(function (d) {
|
|
12251
12254
|
return d.getFullYear() === year && d.getMonth() === month && d.getDate() === day;
|
|
12252
12255
|
});
|
|
12253
|
-
|
|
12256
|
+
if (isEnabled) {
|
|
12257
|
+
isDisabled = false;
|
|
12258
|
+
} else if (!props.disabledDays && !props.disabledDates) {
|
|
12259
|
+
// disable other dates when only enabledDates are present
|
|
12260
|
+
isDisabled = true;
|
|
12261
|
+
}
|
|
12254
12262
|
}
|
|
12255
12263
|
return isDisabled;
|
|
12256
12264
|
};
|
|
@@ -15675,6 +15683,8 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
15675
15683
|
onClick: function onClick(e) {
|
|
15676
15684
|
return _onClick(e);
|
|
15677
15685
|
},
|
|
15686
|
+
'data-p-highlight': checked,
|
|
15687
|
+
'data-p-disabled': props.disabled,
|
|
15678
15688
|
onContextMenu: props.onContextMenu,
|
|
15679
15689
|
onMouseDown: props.onMouseDown
|
|
15680
15690
|
}, otherProps, ptm('root'));
|
|
@@ -15859,22 +15869,29 @@ var styles$T = "\n@layer primereact {\n .p-chips {\n display: inline-f
|
|
|
15859
15869
|
var classes$X = {
|
|
15860
15870
|
removeTokenIcon: 'p-chips-token-icon',
|
|
15861
15871
|
label: 'p-chips-token-label',
|
|
15862
|
-
token:
|
|
15872
|
+
token: function token(_ref) {
|
|
15873
|
+
var focusedIndex = _ref.focusedIndex,
|
|
15874
|
+
index = _ref.index;
|
|
15875
|
+
return classNames('p-chips-token', {
|
|
15876
|
+
'p-focus': focusedIndex === index
|
|
15877
|
+
});
|
|
15878
|
+
},
|
|
15863
15879
|
inputToken: 'p-chips-input-token',
|
|
15864
|
-
container: function container(
|
|
15865
|
-
var
|
|
15866
|
-
focusedState = _ref.focusedState;
|
|
15880
|
+
container: function container(_ref2) {
|
|
15881
|
+
var isFilled = _ref2.isFilled;
|
|
15867
15882
|
return classNames('p-inputtext p-chips-multiple-container', {
|
|
15868
|
-
'p-
|
|
15869
|
-
'p-focus': focusedState
|
|
15883
|
+
'p-variant-filled': isFilled
|
|
15870
15884
|
});
|
|
15871
15885
|
},
|
|
15872
|
-
root: function root(
|
|
15873
|
-
var isFilled =
|
|
15874
|
-
focusedState =
|
|
15886
|
+
root: function root(_ref3) {
|
|
15887
|
+
var isFilled = _ref3.isFilled,
|
|
15888
|
+
focusedState = _ref3.focusedState,
|
|
15889
|
+
disabled = _ref3.disabled;
|
|
15875
15890
|
return classNames('p-chips p-component p-inputwrapper', {
|
|
15876
15891
|
'p-inputwrapper-filled': isFilled,
|
|
15877
|
-
'p-inputwrapper-focus': focusedState
|
|
15892
|
+
'p-inputwrapper-focus': focusedState,
|
|
15893
|
+
'p-disabled': disabled,
|
|
15894
|
+
'p-focus': focusedState
|
|
15878
15895
|
});
|
|
15879
15896
|
}
|
|
15880
15897
|
};
|
|
@@ -15927,6 +15944,10 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
15927
15944
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15928
15945
|
focusedState = _React$useState2[0],
|
|
15929
15946
|
setFocusedState = _React$useState2[1];
|
|
15947
|
+
var _React$useState3 = React.useState(null),
|
|
15948
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
15949
|
+
focusedIndex = _React$useState4[0],
|
|
15950
|
+
setFocusedIndex = _React$useState4[1];
|
|
15930
15951
|
var _ChipsBase$setMetaDat = ChipsBase.setMetaData({
|
|
15931
15952
|
props: props,
|
|
15932
15953
|
state: {
|
|
@@ -15996,26 +16017,71 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
15996
16017
|
var onWrapperClick = function onWrapperClick() {
|
|
15997
16018
|
DomHandler.focus(inputRef.current);
|
|
15998
16019
|
};
|
|
16020
|
+
var onContainerKeyDown = function onContainerKeyDown(event) {
|
|
16021
|
+
switch (event.code) {
|
|
16022
|
+
case 'ArrowLeft':
|
|
16023
|
+
onArrowLeftKeyOn();
|
|
16024
|
+
break;
|
|
16025
|
+
case 'ArrowRight':
|
|
16026
|
+
onArrowRightKeyOn();
|
|
16027
|
+
break;
|
|
16028
|
+
case 'Backspace':
|
|
16029
|
+
onBackspaceKeyOn(event);
|
|
16030
|
+
break;
|
|
16031
|
+
}
|
|
16032
|
+
};
|
|
16033
|
+
var onArrowLeftKeyOn = function onArrowLeftKeyOn() {
|
|
16034
|
+
var focusIndex = focusedIndex;
|
|
16035
|
+
if (inputRef.current.value.length === 0 && props.value && props.value.length > 0) {
|
|
16036
|
+
focusIndex = focusIndex === null ? props.value.length - 1 : focusIndex - 1;
|
|
16037
|
+
if (focusIndex < 0) focusIndex = 0;
|
|
16038
|
+
}
|
|
16039
|
+
setFocusedIndex(focusIndex);
|
|
16040
|
+
};
|
|
16041
|
+
var onArrowRightKeyOn = function onArrowRightKeyOn() {
|
|
16042
|
+
var focusIndex = focusedIndex;
|
|
16043
|
+
if (inputRef.current.value.length === 0 && props.value && props.value.length > 0) {
|
|
16044
|
+
if (focusIndex === props.value.length - 1) {
|
|
16045
|
+
focusIndex = null;
|
|
16046
|
+
inputRef.current.focus();
|
|
16047
|
+
} else {
|
|
16048
|
+
focusIndex++;
|
|
16049
|
+
}
|
|
16050
|
+
}
|
|
16051
|
+
setFocusedIndex(focusIndex);
|
|
16052
|
+
};
|
|
16053
|
+
var onBackspaceKeyOn = function onBackspaceKeyOn(event) {
|
|
16054
|
+
if (focusedIndex !== null) {
|
|
16055
|
+
removeItem(event, focusedIndex);
|
|
16056
|
+
}
|
|
16057
|
+
};
|
|
15999
16058
|
var _onKeyDown = function onKeyDown(event) {
|
|
16000
16059
|
var inputValue = event.target.value;
|
|
16001
16060
|
var values = props.value || [];
|
|
16002
16061
|
props.onKeyDown && props.onKeyDown(event);
|
|
16003
|
-
|
|
16004
|
-
// do not continue if the user defined keydown wants to prevent
|
|
16005
16062
|
if (event.defaultPrevented) {
|
|
16006
16063
|
return;
|
|
16007
16064
|
}
|
|
16008
|
-
switch (event.
|
|
16065
|
+
switch (event.code) {
|
|
16009
16066
|
case 'Backspace':
|
|
16010
|
-
if (
|
|
16067
|
+
if (inputValue.length === 0 && values.length > 0) {
|
|
16011
16068
|
removeItem(event, values.length - 1);
|
|
16012
16069
|
}
|
|
16013
16070
|
break;
|
|
16014
16071
|
case 'Enter':
|
|
16072
|
+
case 'NumpadEnter':
|
|
16015
16073
|
if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
|
|
16016
16074
|
addItem(event, inputValue, true);
|
|
16017
16075
|
}
|
|
16018
16076
|
break;
|
|
16077
|
+
case 'ArrowLeft':
|
|
16078
|
+
if (inputValue.length === 0 && values && values.length > 0) {
|
|
16079
|
+
DomHandler.focus(listRef.current);
|
|
16080
|
+
}
|
|
16081
|
+
break;
|
|
16082
|
+
case 'ArrowRight':
|
|
16083
|
+
event.stopPropagation();
|
|
16084
|
+
break;
|
|
16019
16085
|
default:
|
|
16020
16086
|
if (props.keyfilter) {
|
|
16021
16087
|
KeyFilter.onKeyPress(event, props.keyfilter);
|
|
@@ -16070,8 +16136,16 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
16070
16136
|
}
|
|
16071
16137
|
}
|
|
16072
16138
|
};
|
|
16139
|
+
var onContainerFocus = function onContainerFocus(event) {
|
|
16140
|
+
setFocusedState(true);
|
|
16141
|
+
};
|
|
16142
|
+
var onContainerBlur = function onContainerBlur() {
|
|
16143
|
+
setFocusedIndex(-1);
|
|
16144
|
+
setFocusedState(false);
|
|
16145
|
+
};
|
|
16073
16146
|
var _onFocus = function onFocus(event) {
|
|
16074
16147
|
setFocusedState(true);
|
|
16148
|
+
setFocusedIndex(null);
|
|
16075
16149
|
props.onFocus && props.onFocus(event);
|
|
16076
16150
|
};
|
|
16077
16151
|
var _onBlur = function onBlur(event) {
|
|
@@ -16121,6 +16195,9 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
16121
16195
|
DomHandler.focus(inputRef.current, props.autoFocus);
|
|
16122
16196
|
}
|
|
16123
16197
|
});
|
|
16198
|
+
var focusedOptionId = function focusedOptionId() {
|
|
16199
|
+
return focusedIndex !== null ? "".concat(props.inputId, "_chips_item_").concat(focusedIndex) : null;
|
|
16200
|
+
};
|
|
16124
16201
|
var createRemoveIcon = function createRemoveIcon(value, index) {
|
|
16125
16202
|
var iconProps = mergeProps({
|
|
16126
16203
|
className: cx('removeTokenIcon'),
|
|
@@ -16146,9 +16223,19 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
16146
16223
|
var label = /*#__PURE__*/React.createElement("span", labelProps, content);
|
|
16147
16224
|
var icon = createRemoveIcon(value, index);
|
|
16148
16225
|
var tokenProps = mergeProps({
|
|
16149
|
-
key: index,
|
|
16150
|
-
|
|
16151
|
-
'
|
|
16226
|
+
key: "".concat(index, "_").concat(value),
|
|
16227
|
+
id: props.inputId + '_chips_item_' + index,
|
|
16228
|
+
role: 'option',
|
|
16229
|
+
'aria-label': value,
|
|
16230
|
+
className: cx('token', {
|
|
16231
|
+
focusedIndex: focusedIndex,
|
|
16232
|
+
index: index
|
|
16233
|
+
}),
|
|
16234
|
+
'aria-selected': true,
|
|
16235
|
+
'aria-setsize': props.value.length,
|
|
16236
|
+
'aria-posinset': index + 1,
|
|
16237
|
+
'data-p-highlight': true,
|
|
16238
|
+
'data-p-focused': focusedIndex === index
|
|
16152
16239
|
}, ptm('token'));
|
|
16153
16240
|
return /*#__PURE__*/React.createElement("li", tokenProps, label, icon);
|
|
16154
16241
|
};
|
|
@@ -16188,13 +16275,24 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
16188
16275
|
var containerProps = mergeProps({
|
|
16189
16276
|
ref: listRef,
|
|
16190
16277
|
className: cx('container', {
|
|
16191
|
-
|
|
16278
|
+
isFilled: isFilled
|
|
16192
16279
|
}),
|
|
16193
16280
|
onClick: function onClick(e) {
|
|
16194
16281
|
return onWrapperClick();
|
|
16195
16282
|
},
|
|
16283
|
+
onKeyDown: function onKeyDown(e) {
|
|
16284
|
+
return onContainerKeyDown(e);
|
|
16285
|
+
},
|
|
16286
|
+
tabIndex: -1,
|
|
16287
|
+
role: 'listbox',
|
|
16288
|
+
'aria-orientation': 'horizontal',
|
|
16289
|
+
'aria-labelledby': props.ariaLabelledby,
|
|
16290
|
+
'aria-label': props.ariaLabel,
|
|
16291
|
+
'aria-activedescendant': focusedState ? focusedOptionId() : undefined,
|
|
16196
16292
|
'data-p-disabled': props.disabled,
|
|
16197
|
-
'data-p-focus': focusedState
|
|
16293
|
+
'data-p-focus': focusedState,
|
|
16294
|
+
onFocus: onContainerFocus,
|
|
16295
|
+
onBlur: onContainerBlur
|
|
16198
16296
|
}, ptm('container'));
|
|
16199
16297
|
return /*#__PURE__*/React.createElement("ul", containerProps, items, input);
|
|
16200
16298
|
};
|
|
@@ -16207,7 +16305,8 @@ var Chips = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inP
|
|
|
16207
16305
|
ref: elementRef,
|
|
16208
16306
|
className: classNames(props.className, cx('root', {
|
|
16209
16307
|
isFilled: isFilled,
|
|
16210
|
-
focusedState: focusedState
|
|
16308
|
+
focusedState: focusedState,
|
|
16309
|
+
disabled: props.disabled
|
|
16211
16310
|
})),
|
|
16212
16311
|
style: props.style
|
|
16213
16312
|
}, ptm('root'));
|
|
@@ -20028,7 +20127,7 @@ var FirstPageLink = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
20028
20127
|
}),
|
|
20029
20128
|
onClick: props.onClick,
|
|
20030
20129
|
disabled: props.disabled,
|
|
20031
|
-
'aria-label': ariaLabel
|
|
20130
|
+
'aria-label': ariaLabel('firstPageLabel')
|
|
20032
20131
|
}, getPTOptions('firstPageButton'));
|
|
20033
20132
|
var element = /*#__PURE__*/React.createElement("button", firstPageButtonProps, firstPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
20034
20133
|
if (props.template) {
|
|
@@ -20438,36 +20537,36 @@ var InputNumber = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
20438
20537
|
if (event.altKey) {
|
|
20439
20538
|
event.preventDefault();
|
|
20440
20539
|
}
|
|
20441
|
-
switch (event.
|
|
20540
|
+
switch (event.code) {
|
|
20442
20541
|
//up
|
|
20443
|
-
case
|
|
20542
|
+
case 'ArrowUp':
|
|
20444
20543
|
spin(event, 1);
|
|
20445
20544
|
event.preventDefault();
|
|
20446
20545
|
break;
|
|
20447
20546
|
|
|
20448
20547
|
//down
|
|
20449
|
-
case
|
|
20548
|
+
case 'ArrowDown':
|
|
20450
20549
|
spin(event, -1);
|
|
20451
20550
|
event.preventDefault();
|
|
20452
20551
|
break;
|
|
20453
20552
|
|
|
20454
20553
|
//left
|
|
20455
|
-
case
|
|
20554
|
+
case 'ArrowLeft':
|
|
20456
20555
|
if (!isNumeralChar(inputValue.charAt(selectionStart - 1))) {
|
|
20457
20556
|
event.preventDefault();
|
|
20458
20557
|
}
|
|
20459
20558
|
break;
|
|
20460
20559
|
|
|
20461
20560
|
//right
|
|
20462
|
-
case
|
|
20561
|
+
case 'ArrowRight':
|
|
20463
20562
|
if (!isNumeralChar(inputValue.charAt(selectionStart))) {
|
|
20464
20563
|
event.preventDefault();
|
|
20465
20564
|
}
|
|
20466
20565
|
break;
|
|
20467
20566
|
|
|
20468
20567
|
//enter and tab
|
|
20469
|
-
case
|
|
20470
|
-
case
|
|
20568
|
+
case 'Tab':
|
|
20569
|
+
case 'Enter':
|
|
20471
20570
|
newValueStr = validateValue(parseValue(inputValue));
|
|
20472
20571
|
inputRef.current.value = formatValue(newValueStr);
|
|
20473
20572
|
inputRef.current.setAttribute('aria-valuenow', newValueStr);
|
|
@@ -20475,7 +20574,7 @@ var InputNumber = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
20475
20574
|
break;
|
|
20476
20575
|
|
|
20477
20576
|
//backspace
|
|
20478
|
-
case
|
|
20577
|
+
case 'Backspace':
|
|
20479
20578
|
event.preventDefault();
|
|
20480
20579
|
if (selectionStart === selectionEnd) {
|
|
20481
20580
|
var deleteChar = inputValue.charAt(selectionStart - 1);
|
|
@@ -20519,7 +20618,7 @@ var InputNumber = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
20519
20618
|
break;
|
|
20520
20619
|
|
|
20521
20620
|
// del
|
|
20522
|
-
case
|
|
20621
|
+
case 'Delete':
|
|
20523
20622
|
event.preventDefault();
|
|
20524
20623
|
if (selectionStart === selectionEnd) {
|
|
20525
20624
|
var _deleteChar = inputValue.charAt(selectionStart);
|
|
@@ -20554,14 +20653,18 @@ var InputNumber = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
20554
20653
|
updateValue(event, newValueStr, null, 'delete-range');
|
|
20555
20654
|
}
|
|
20556
20655
|
break;
|
|
20557
|
-
|
|
20558
|
-
|
|
20559
|
-
|
|
20560
|
-
|
|
20561
|
-
|
|
20562
|
-
|
|
20563
|
-
|
|
20564
|
-
|
|
20656
|
+
case 'End':
|
|
20657
|
+
event.preventDefault();
|
|
20658
|
+
if (!ObjectUtils.isEmpty(props.max)) {
|
|
20659
|
+
updateModel(event, props.max);
|
|
20660
|
+
}
|
|
20661
|
+
break;
|
|
20662
|
+
case 'Home':
|
|
20663
|
+
event.preventDefault();
|
|
20664
|
+
if (!ObjectUtils.isEmpty(props.min)) {
|
|
20665
|
+
updateModel(event, props.min);
|
|
20666
|
+
}
|
|
20667
|
+
break;
|
|
20565
20668
|
}
|
|
20566
20669
|
};
|
|
20567
20670
|
var onInputKeyUp = function onInputKeyUp(event) {
|
|
@@ -21222,7 +21325,7 @@ var JumpToPageInput = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
21222
21325
|
onChange: onChange,
|
|
21223
21326
|
disabled: props.disabled,
|
|
21224
21327
|
className: 'p-paginator-page-input',
|
|
21225
|
-
|
|
21328
|
+
'aria-label': ariaLabelValue,
|
|
21226
21329
|
element: element,
|
|
21227
21330
|
props: props
|
|
21228
21331
|
};
|
|
@@ -21266,7 +21369,7 @@ var LastPageLink = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
21266
21369
|
}),
|
|
21267
21370
|
onClick: props.onClick,
|
|
21268
21371
|
disabled: props.disabled,
|
|
21269
|
-
'aria-label': ariaLabel
|
|
21372
|
+
'aria-label': ariaLabel('lastPageLabel')
|
|
21270
21373
|
}, getPTOptions('lastPageButton'));
|
|
21271
21374
|
var element = /*#__PURE__*/React.createElement("button", lastPageButtonProps, lastPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
21272
21375
|
if (props.template) {
|
|
@@ -21318,7 +21421,7 @@ var NextPageLink = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
21318
21421
|
}),
|
|
21319
21422
|
onClick: props.onClick,
|
|
21320
21423
|
disabled: props.disabled,
|
|
21321
|
-
'aria-label': ariaLabel
|
|
21424
|
+
'aria-label': ariaLabel('nextPageLabel')
|
|
21322
21425
|
}, getPTOptions('nextPageButton'));
|
|
21323
21426
|
var element = /*#__PURE__*/React.createElement("button", nextPageButtonProps, nextPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
21324
21427
|
if (props.template) {
|
|
@@ -21382,7 +21485,7 @@ var PageLinks = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
21382
21485
|
page: props.page
|
|
21383
21486
|
}),
|
|
21384
21487
|
disabled: props.disabled,
|
|
21385
|
-
'aria-label': ariaLabel
|
|
21488
|
+
'aria-label': ariaLabel('pageLabel', {
|
|
21386
21489
|
page: pageLink
|
|
21387
21490
|
}),
|
|
21388
21491
|
'aria-current': pageLink - 1 === props.page ? 'true' : undefined
|
|
@@ -21401,7 +21504,7 @@ var PageLinks = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
21401
21504
|
page: pageLink - 1,
|
|
21402
21505
|
currentPage: props.page,
|
|
21403
21506
|
totalPages: props.pageCount,
|
|
21404
|
-
ariaLabel: ariaLabel
|
|
21507
|
+
ariaLabel: ariaLabel('pageLabel', {
|
|
21405
21508
|
page: pageLink
|
|
21406
21509
|
}),
|
|
21407
21510
|
ariaCurrent: pageLink - 1 === props.page ? 'true' : undefined,
|
|
@@ -21458,7 +21561,7 @@ var PrevPageLink = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
21458
21561
|
}),
|
|
21459
21562
|
onClick: props.onClick,
|
|
21460
21563
|
disabled: props.disabled,
|
|
21461
|
-
'aria-label': ariaLabel
|
|
21564
|
+
'aria-label': ariaLabel('previousPageLabel')
|
|
21462
21565
|
}, getPTOptions('prevPageButton'));
|
|
21463
21566
|
var element = /*#__PURE__*/React.createElement("button", prevPageButtonProps, prevPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
21464
21567
|
if (props.template) {
|
|
@@ -21531,10 +21634,13 @@ var classes$O = {
|
|
|
21531
21634
|
item: function item(_ref7) {
|
|
21532
21635
|
var selected = _ref7.selected,
|
|
21533
21636
|
disabled = _ref7.disabled,
|
|
21534
|
-
label = _ref7.label
|
|
21637
|
+
label = _ref7.label,
|
|
21638
|
+
index = _ref7.index,
|
|
21639
|
+
focusedOptionIndex = _ref7.focusedOptionIndex;
|
|
21535
21640
|
return classNames('p-dropdown-item', {
|
|
21536
21641
|
'p-highlight': selected,
|
|
21537
21642
|
'p-disabled': disabled,
|
|
21643
|
+
'p-focus': index === focusedOptionIndex,
|
|
21538
21644
|
'p-dropdown-item-empty': !label || label.length === 0
|
|
21539
21645
|
});
|
|
21540
21646
|
},
|
|
@@ -21601,6 +21707,8 @@ var DropdownBase = ComponentBase.extend({
|
|
|
21601
21707
|
onShow: null,
|
|
21602
21708
|
optionDisabled: null,
|
|
21603
21709
|
optionGroupChildren: 'items',
|
|
21710
|
+
selectOnFocus: false,
|
|
21711
|
+
autoOptionFocus: false,
|
|
21604
21712
|
optionGroupLabel: null,
|
|
21605
21713
|
optionGroupTemplate: null,
|
|
21606
21714
|
optionLabel: null,
|
|
@@ -21639,7 +21747,9 @@ var DropdownItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
21639
21747
|
selected = props.selected,
|
|
21640
21748
|
disabled = props.disabled,
|
|
21641
21749
|
option = props.option,
|
|
21642
|
-
label = props.label
|
|
21750
|
+
label = props.label,
|
|
21751
|
+
index = props.index,
|
|
21752
|
+
focusedOptionIndex = props.focusedOptionIndex;
|
|
21643
21753
|
var getPTOptions = function getPTOptions(key) {
|
|
21644
21754
|
return ptm(key, {
|
|
21645
21755
|
context: {
|
|
@@ -21648,7 +21758,7 @@ var DropdownItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
21648
21758
|
}
|
|
21649
21759
|
});
|
|
21650
21760
|
};
|
|
21651
|
-
var _onClick = function onClick(event) {
|
|
21761
|
+
var _onClick = function onClick(event, i) {
|
|
21652
21762
|
if (props.onClick) {
|
|
21653
21763
|
props.onClick({
|
|
21654
21764
|
originalEvent: event,
|
|
@@ -21663,7 +21773,9 @@ var DropdownItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
21663
21773
|
className: classNames(option.className, cx('item', {
|
|
21664
21774
|
selected: selected,
|
|
21665
21775
|
disabled: disabled,
|
|
21666
|
-
label: label
|
|
21776
|
+
label: label,
|
|
21777
|
+
index: index,
|
|
21778
|
+
focusedOptionIndex: focusedOptionIndex
|
|
21667
21779
|
})),
|
|
21668
21780
|
style: props.style,
|
|
21669
21781
|
onClick: function onClick(e) {
|
|
@@ -21672,6 +21784,7 @@ var DropdownItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
21672
21784
|
'aria-label': label,
|
|
21673
21785
|
'aria-selected': selected,
|
|
21674
21786
|
'data-p-highlight': selected,
|
|
21787
|
+
'data-p-focused': focusedOptionIndex === index,
|
|
21675
21788
|
'data-p-disabled': disabled
|
|
21676
21789
|
}, getPTOptions('item'));
|
|
21677
21790
|
return /*#__PURE__*/React.createElement("li", itemProps, content, /*#__PURE__*/React.createElement(Ripple, null));
|
|
@@ -21743,6 +21856,8 @@ var DropdownPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(funct
|
|
|
21743
21856
|
var disabled = props.isOptionDisabled(option);
|
|
21744
21857
|
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
21745
21858
|
key: optionKey,
|
|
21859
|
+
index: j,
|
|
21860
|
+
focusedOptionIndex: props.focusedOptionIndex,
|
|
21746
21861
|
label: optionLabel,
|
|
21747
21862
|
option: option,
|
|
21748
21863
|
style: style,
|
|
@@ -21790,6 +21905,8 @@ var DropdownPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(funct
|
|
|
21790
21905
|
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
21791
21906
|
key: optionKey,
|
|
21792
21907
|
label: optionLabel,
|
|
21908
|
+
index: index,
|
|
21909
|
+
focusedOptionIndex: props.focusedOptionIndex,
|
|
21793
21910
|
option: option,
|
|
21794
21911
|
style: style,
|
|
21795
21912
|
template: props.itemTemplate,
|
|
@@ -21982,20 +22099,30 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
21982
22099
|
setFilterState = _React$useState2[1];
|
|
21983
22100
|
var _React$useState3 = React.useState(false),
|
|
21984
22101
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
21985
|
-
|
|
21986
|
-
|
|
22102
|
+
clicked = _React$useState4[0],
|
|
22103
|
+
setClicked = _React$useState4[1];
|
|
21987
22104
|
var _React$useState5 = React.useState(false),
|
|
21988
22105
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
21989
|
-
|
|
21990
|
-
|
|
22106
|
+
focusedState = _React$useState6[0],
|
|
22107
|
+
setFocusedState = _React$useState6[1];
|
|
22108
|
+
var _React$useState7 = React.useState(null),
|
|
22109
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
22110
|
+
focusedOptionIndex = _React$useState8[0],
|
|
22111
|
+
setFocusedOptionIndex = _React$useState8[1];
|
|
22112
|
+
var _React$useState9 = React.useState(false),
|
|
22113
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
22114
|
+
overlayVisibleState = _React$useState10[0],
|
|
22115
|
+
setOverlayVisibleState = _React$useState10[1];
|
|
21991
22116
|
var elementRef = React.useRef(null);
|
|
21992
22117
|
var overlayRef = React.useRef(null);
|
|
22118
|
+
var firstHiddenFocusableElementOnOverlay = React.useRef(null);
|
|
22119
|
+
var lastHiddenFocusableElementOnOverlay = React.useRef(null);
|
|
21993
22120
|
var inputRef = React.useRef(props.inputRef);
|
|
21994
22121
|
var focusInputRef = React.useRef(props.focusInputRef);
|
|
21995
22122
|
var virtualScrollerRef = React.useRef(null);
|
|
21996
22123
|
var searchTimeout = React.useRef(null);
|
|
21997
22124
|
var searchValue = React.useRef(null);
|
|
21998
|
-
|
|
22125
|
+
React.useRef(null);
|
|
21999
22126
|
var isLazy = props.virtualScrollerOptions && props.virtualScrollerOptions.lazy;
|
|
22000
22127
|
var hasFilter = ObjectUtils.isNotEmpty(filterState);
|
|
22001
22128
|
var appendTo = props.appendTo || context && context.appendTo || PrimeReact.appendTo;
|
|
@@ -22059,6 +22186,14 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22059
22186
|
return props.options;
|
|
22060
22187
|
}
|
|
22061
22188
|
};
|
|
22189
|
+
var onFirstHiddenFocus = function onFirstHiddenFocus(event) {
|
|
22190
|
+
var focusableEl = event.relatedTarget === focusInputRef.current ? DomHandler.getFirstFocusableElement(overlayRef.current, ':not([data-p-hidden-focusable="true"])') : focusInputRef.current;
|
|
22191
|
+
DomHandler.focus(focusableEl);
|
|
22192
|
+
};
|
|
22193
|
+
var onLastHiddenFocus = function onLastHiddenFocus(event) {
|
|
22194
|
+
var focusableEl = event.relatedTarget === focusInputRef.current ? DomHandler.getLastFocusableElement(overlayRef.current, ':not([data-p-hidden-focusable="true"])') : focusInputRef.current;
|
|
22195
|
+
DomHandler.focus(focusableEl);
|
|
22196
|
+
};
|
|
22062
22197
|
var isClearClicked = function isClearClicked(event) {
|
|
22063
22198
|
return DomHandler.isAttributeEquals(event.target, 'data-pc-section', 'clearicon') || DomHandler.isAttributeEquals(event.target.parentElement || event.target, 'data-pc-section', 'filterclearicon');
|
|
22064
22199
|
};
|
|
@@ -22078,6 +22213,7 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22078
22213
|
DomHandler.focus(focusInputRef.current);
|
|
22079
22214
|
overlayVisibleState ? hide() : show();
|
|
22080
22215
|
}
|
|
22216
|
+
setClicked(true);
|
|
22081
22217
|
};
|
|
22082
22218
|
var onInputFocus = function onInputFocus(event) {
|
|
22083
22219
|
if (props.showOnFocus && !overlayVisibleState) {
|
|
@@ -22109,6 +22245,15 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22109
22245
|
}, 200);
|
|
22110
22246
|
}
|
|
22111
22247
|
};
|
|
22248
|
+
var onOptionSelect = function onOptionSelect(event, option) {
|
|
22249
|
+
var isHide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
22250
|
+
var value = getOptionValue(option);
|
|
22251
|
+
selectItem({
|
|
22252
|
+
originalEvent: event,
|
|
22253
|
+
option: value
|
|
22254
|
+
});
|
|
22255
|
+
isHide && hide();
|
|
22256
|
+
};
|
|
22112
22257
|
var onPanelClick = function onPanelClick(event) {
|
|
22113
22258
|
OverlayService.emit('overlay-click', {
|
|
22114
22259
|
originalEvent: event,
|
|
@@ -22116,189 +22261,285 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22116
22261
|
});
|
|
22117
22262
|
};
|
|
22118
22263
|
var onInputKeyDown = function onInputKeyDown(event) {
|
|
22264
|
+
if (props.disabled || DomHandler.isAndroid()) {
|
|
22265
|
+
event.preventDefault();
|
|
22266
|
+
return;
|
|
22267
|
+
}
|
|
22268
|
+
var metaKey = event.metaKey || event.ctrlKey;
|
|
22119
22269
|
switch (event.code) {
|
|
22120
22270
|
case 'ArrowDown':
|
|
22121
|
-
|
|
22271
|
+
onArrowDownKey(event);
|
|
22122
22272
|
break;
|
|
22123
22273
|
case 'ArrowUp':
|
|
22124
|
-
|
|
22274
|
+
onArrowUpKey(event);
|
|
22275
|
+
break;
|
|
22276
|
+
case 'ArrowLeft':
|
|
22277
|
+
case 'ArrowRight':
|
|
22278
|
+
onArrowLeftKey(event, props.editable);
|
|
22279
|
+
break;
|
|
22280
|
+
case 'Home':
|
|
22281
|
+
onHomeKey(event);
|
|
22282
|
+
break;
|
|
22283
|
+
case 'End':
|
|
22284
|
+
onEndKey(event);
|
|
22285
|
+
break;
|
|
22286
|
+
case 'PageDown':
|
|
22287
|
+
onPageDownKey(event);
|
|
22288
|
+
break;
|
|
22289
|
+
case 'PageUp':
|
|
22290
|
+
onPageUpKey(event);
|
|
22125
22291
|
break;
|
|
22126
22292
|
case 'Space':
|
|
22293
|
+
onSpaceKey(event, props.editable);
|
|
22294
|
+
break;
|
|
22295
|
+
case 'NumpadEnter':
|
|
22127
22296
|
case 'Enter':
|
|
22128
|
-
|
|
22129
|
-
event.preventDefault();
|
|
22297
|
+
onEnterKey(event);
|
|
22130
22298
|
break;
|
|
22131
22299
|
case 'Escape':
|
|
22300
|
+
onEscapeKey(event);
|
|
22301
|
+
break;
|
|
22132
22302
|
case 'Tab':
|
|
22133
|
-
|
|
22303
|
+
onTabKey(event);
|
|
22304
|
+
break;
|
|
22305
|
+
case 'Backspace':
|
|
22306
|
+
onBackspaceKey(event, props.editable);
|
|
22307
|
+
break;
|
|
22308
|
+
case 'ShiftLeft':
|
|
22309
|
+
case 'ShiftRight':
|
|
22310
|
+
//NOOP
|
|
22134
22311
|
break;
|
|
22135
22312
|
default:
|
|
22136
|
-
|
|
22313
|
+
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
|
22314
|
+
!overlayVisibleState && show();
|
|
22315
|
+
!props.editable && searchOptions(event, event.key);
|
|
22316
|
+
}
|
|
22137
22317
|
break;
|
|
22138
22318
|
}
|
|
22319
|
+
setClicked(false);
|
|
22139
22320
|
};
|
|
22140
22321
|
var onFilterInputKeyDown = function onFilterInputKeyDown(event) {
|
|
22141
22322
|
switch (event.code) {
|
|
22142
22323
|
case 'ArrowDown':
|
|
22143
|
-
|
|
22324
|
+
onArrowDownKey(event);
|
|
22144
22325
|
break;
|
|
22145
22326
|
case 'ArrowUp':
|
|
22146
|
-
|
|
22327
|
+
onArrowUpKey(event);
|
|
22328
|
+
break;
|
|
22329
|
+
case 'ArrowLeft':
|
|
22330
|
+
case 'ArrowRight':
|
|
22331
|
+
onArrowLeftKey(event, true);
|
|
22147
22332
|
break;
|
|
22148
22333
|
case 'Escape':
|
|
22149
22334
|
case 'Enter':
|
|
22150
|
-
|
|
22335
|
+
onEnterKey(event);
|
|
22151
22336
|
event.preventDefault();
|
|
22152
22337
|
break;
|
|
22153
22338
|
}
|
|
22154
22339
|
};
|
|
22155
|
-
var
|
|
22156
|
-
|
|
22157
|
-
var prevOption = findPrevOption(getSelectedOptionIndex());
|
|
22158
|
-
if (prevOption) {
|
|
22159
|
-
selectItem({
|
|
22160
|
-
originalEvent: event,
|
|
22161
|
-
option: prevOption
|
|
22162
|
-
});
|
|
22163
|
-
}
|
|
22164
|
-
}
|
|
22165
|
-
event.preventDefault();
|
|
22340
|
+
var hasFocusableElements = function hasFocusableElements() {
|
|
22341
|
+
return DomHandler.getFocusableElements(overlayRef.current, ':not([data-p-hidden-focusable="true"])').length > 0;
|
|
22166
22342
|
};
|
|
22167
|
-
var
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
show();
|
|
22171
|
-
} else {
|
|
22172
|
-
var nextOption = findNextOption(getSelectedOptionIndex());
|
|
22173
|
-
if (nextOption) {
|
|
22174
|
-
selectItem({
|
|
22175
|
-
originalEvent: event,
|
|
22176
|
-
option: nextOption
|
|
22177
|
-
});
|
|
22178
|
-
}
|
|
22179
|
-
}
|
|
22180
|
-
}
|
|
22181
|
-
event.preventDefault();
|
|
22343
|
+
var isOptionMatched = function isOptionMatched(option) {
|
|
22344
|
+
var _getOptionLabel;
|
|
22345
|
+
return isValidOption(option) && ((_getOptionLabel = getOptionLabel(option)) === null || _getOptionLabel === void 0 ? void 0 : _getOptionLabel.toLocaleLowerCase(props.filterLocale).startsWith(searchValue.current.toLocaleLowerCase(props.filterLocale)));
|
|
22182
22346
|
};
|
|
22183
|
-
var
|
|
22184
|
-
|
|
22185
|
-
var groupIndex = index === -1 ? 0 : index.group;
|
|
22186
|
-
var optionIndex = index === -1 ? -1 : index.option;
|
|
22187
|
-
var option = findNextOptionInList(getOptionGroupChildren(visibleOptions[groupIndex]), optionIndex);
|
|
22188
|
-
if (option) return option;else if (groupIndex + 1 !== visibleOptions.length) return findNextOption({
|
|
22189
|
-
group: groupIndex + 1,
|
|
22190
|
-
option: -1
|
|
22191
|
-
});else return null;
|
|
22192
|
-
}
|
|
22193
|
-
return findNextOptionInList(visibleOptions, index);
|
|
22194
|
-
};
|
|
22195
|
-
var findNextOptionInList = function findNextOptionInList(list, index) {
|
|
22196
|
-
var i = index + 1;
|
|
22197
|
-
if (i === list.length) {
|
|
22198
|
-
return null;
|
|
22199
|
-
}
|
|
22200
|
-
var option = list[i];
|
|
22201
|
-
return isOptionDisabled(option) ? findNextOptionInList(i) : option;
|
|
22347
|
+
var isValidOption = function isValidOption(option) {
|
|
22348
|
+
return ObjectUtils.isNotEmpty(option) && !(isOptionDisabled(option) || isOptionGroup(option));
|
|
22202
22349
|
};
|
|
22203
|
-
var
|
|
22204
|
-
|
|
22205
|
-
|
|
22206
|
-
|
|
22207
|
-
|
|
22208
|
-
|
|
22209
|
-
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
return
|
|
22217
|
-
};
|
|
22218
|
-
var findPrevOptionInList = function findPrevOptionInList(list, index) {
|
|
22219
|
-
var i = index - 1;
|
|
22220
|
-
if (i < 0) {
|
|
22221
|
-
return null;
|
|
22222
|
-
}
|
|
22223
|
-
var option = list[i];
|
|
22224
|
-
return isOptionDisabled(option) ? findPrevOption(i) : option;
|
|
22350
|
+
var hasSelectedOption = function hasSelectedOption() {
|
|
22351
|
+
return ObjectUtils.isNotEmpty(props.value);
|
|
22352
|
+
};
|
|
22353
|
+
var isValidSelectedOption = function isValidSelectedOption(option) {
|
|
22354
|
+
return isValidOption(option) && isSelected(option);
|
|
22355
|
+
};
|
|
22356
|
+
var findSelectedOptionIndex = function findSelectedOptionIndex() {
|
|
22357
|
+
return hasSelectedOption ? visibleOptions.findIndex(function (option) {
|
|
22358
|
+
return isValidSelectedOption(option);
|
|
22359
|
+
}) : -1;
|
|
22360
|
+
};
|
|
22361
|
+
var findFirstFocusedOptionIndex = function findFirstFocusedOptionIndex() {
|
|
22362
|
+
var selectedIndex = findSelectedOptionIndex();
|
|
22363
|
+
return selectedIndex < 0 ? findFirstOptionIndex() : selectedIndex;
|
|
22225
22364
|
};
|
|
22226
|
-
var
|
|
22365
|
+
var searchOptions = function searchOptions(event, _char) {
|
|
22366
|
+
searchValue.current = (searchValue.current || '') + _char;
|
|
22367
|
+
var optionIndex = -1;
|
|
22368
|
+
var matched = false;
|
|
22369
|
+
if (ObjectUtils.isNotEmpty(searchValue.current)) {
|
|
22370
|
+
if (focusedOptionIndex !== -1) {
|
|
22371
|
+
optionIndex = visibleOptions.slice(focusedOptionIndex).findIndex(function (option) {
|
|
22372
|
+
return isOptionMatched(option);
|
|
22373
|
+
});
|
|
22374
|
+
optionIndex = optionIndex === -1 ? visibleOptions.slice(0, focusedOptionIndex).findIndex(function (option) {
|
|
22375
|
+
return isOptionMatched(option);
|
|
22376
|
+
}) : optionIndex + focusedOptionIndex;
|
|
22377
|
+
} else {
|
|
22378
|
+
optionIndex = visibleOptions.findIndex(function (option) {
|
|
22379
|
+
return isOptionMatched(option);
|
|
22380
|
+
});
|
|
22381
|
+
}
|
|
22382
|
+
if (optionIndex !== -1) {
|
|
22383
|
+
matched = true;
|
|
22384
|
+
}
|
|
22385
|
+
if (optionIndex === -1 && focusedOptionIndex === -1) {
|
|
22386
|
+
optionIndex = findFirstFocusedOptionIndex();
|
|
22387
|
+
}
|
|
22388
|
+
if (optionIndex !== -1) {
|
|
22389
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
22390
|
+
}
|
|
22391
|
+
}
|
|
22227
22392
|
if (searchTimeout.current) {
|
|
22228
22393
|
clearTimeout(searchTimeout.current);
|
|
22229
22394
|
}
|
|
22230
|
-
|
|
22231
|
-
|
|
22232
|
-
|
|
22395
|
+
searchTimeout.current = setTimeout(function () {
|
|
22396
|
+
searchValue.current = '';
|
|
22397
|
+
searchTimeout.current = null;
|
|
22398
|
+
}, 500);
|
|
22399
|
+
return matched;
|
|
22400
|
+
};
|
|
22401
|
+
var findLastFocusedOptionIndex = function findLastFocusedOptionIndex() {
|
|
22402
|
+
var selectedIndex = findSelectedOptionIndex();
|
|
22403
|
+
return selectedIndex < 0 ? findLastOptionIndex() : selectedIndex;
|
|
22404
|
+
};
|
|
22405
|
+
var findFirstOptionIndex = function findFirstOptionIndex() {
|
|
22406
|
+
return visibleOptions.findIndex(function (option) {
|
|
22407
|
+
return isValidOption(option);
|
|
22408
|
+
});
|
|
22409
|
+
};
|
|
22410
|
+
var findLastOptionIndex = function findLastOptionIndex() {
|
|
22411
|
+
return ObjectUtils.findLastIndex(visibleOptions, function (option) {
|
|
22412
|
+
return isValidOption(option);
|
|
22413
|
+
});
|
|
22414
|
+
};
|
|
22415
|
+
var findNextOptionIndex = function findNextOptionIndex(index) {
|
|
22416
|
+
var matchedOptionIndex = index < visibleOptions.length - 1 ? visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
22417
|
+
return isValidOption(option);
|
|
22418
|
+
}) : -1;
|
|
22419
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
|
|
22420
|
+
};
|
|
22421
|
+
var findPrevOptionIndex = function findPrevOptionIndex(index) {
|
|
22422
|
+
var matchedOptionIndex = index > 0 ? ObjectUtils.findLastIndex(visibleOptions.slice(0, index), function (option) {
|
|
22423
|
+
return isValidOption(option);
|
|
22424
|
+
}) : -1;
|
|
22425
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
22426
|
+
};
|
|
22427
|
+
var changeFocusedOptionIndex = function changeFocusedOptionIndex(event, index) {
|
|
22428
|
+
if (focusedOptionIndex !== index) {
|
|
22429
|
+
setFocusedOptionIndex(index);
|
|
22430
|
+
if (props.selectOnFocus) {
|
|
22431
|
+
onOptionSelect(event, visibleOptions[index], false);
|
|
22432
|
+
}
|
|
22233
22433
|
}
|
|
22234
|
-
|
|
22235
|
-
|
|
22236
|
-
|
|
22237
|
-
|
|
22434
|
+
};
|
|
22435
|
+
var onArrowDownKey = function onArrowDownKey(event) {
|
|
22436
|
+
if (!overlayVisibleState) {
|
|
22437
|
+
show();
|
|
22438
|
+
props.editable && changeFocusedOptionIndex(event, findSelectedOptionIndex());
|
|
22439
|
+
} else {
|
|
22440
|
+
var optionIndex = focusedOptionIndex !== -1 ? findNextOptionIndex(focusedOptionIndex) : clicked ? findFirstOptionIndex() : findFirstFocusedOptionIndex();
|
|
22441
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
22238
22442
|
}
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22243
|
-
|
|
22244
|
-
if (
|
|
22245
|
-
|
|
22246
|
-
originalEvent: event,
|
|
22247
|
-
option: newOption
|
|
22248
|
-
});
|
|
22443
|
+
event.preventDefault();
|
|
22444
|
+
};
|
|
22445
|
+
var onArrowUpKey = function onArrowUpKey(event) {
|
|
22446
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22447
|
+
if (event.altKey && !pressedInInputText) {
|
|
22448
|
+
if (focusedOptionIndex !== -1) {
|
|
22449
|
+
onOptionSelect(event, visibleOptions[focusedOptionIndex]);
|
|
22249
22450
|
}
|
|
22451
|
+
state.overlayVisible && hide();
|
|
22452
|
+
event.preventDefault();
|
|
22453
|
+
} else {
|
|
22454
|
+
var optionIndex = focusedOptionIndex !== -1 ? findPrevOptionIndex(focusedOptionIndex) : clicked ? findLastOptionIndex() : findLastFocusedOptionIndex();
|
|
22455
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
22456
|
+
!overlayVisibleState && show();
|
|
22457
|
+
event.preventDefault();
|
|
22250
22458
|
}
|
|
22251
|
-
searchTimeout.current = setTimeout(function () {
|
|
22252
|
-
searchValue.current = null;
|
|
22253
|
-
}, 250);
|
|
22254
22459
|
};
|
|
22255
|
-
var
|
|
22256
|
-
|
|
22257
|
-
|
|
22460
|
+
var onArrowLeftKey = function onArrowLeftKey(event) {
|
|
22461
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22462
|
+
pressedInInputText && setFocusedOptionIndex(-1);
|
|
22463
|
+
};
|
|
22464
|
+
var onHomeKey = function onHomeKey(event) {
|
|
22465
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22466
|
+
if (pressedInInputText) {
|
|
22467
|
+
event.currentTarget.setSelectionRange(0, 0);
|
|
22468
|
+
setFocusedOptionIndex(-1);
|
|
22469
|
+
} else {
|
|
22470
|
+
changeFocusedOptionIndex(event, findFirstOptionIndex());
|
|
22471
|
+
!overlayVisibleState && show();
|
|
22258
22472
|
}
|
|
22259
|
-
|
|
22473
|
+
event.preventDefault();
|
|
22260
22474
|
};
|
|
22261
|
-
var
|
|
22262
|
-
|
|
22263
|
-
|
|
22264
|
-
|
|
22265
|
-
|
|
22266
|
-
|
|
22475
|
+
var onEndKey = function onEndKey(event) {
|
|
22476
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22477
|
+
if (pressedInInputText) {
|
|
22478
|
+
var target = event.currentTarget;
|
|
22479
|
+
var len = target.value.length;
|
|
22480
|
+
target.setSelectionRange(len, len);
|
|
22481
|
+
setFocusedOptionIndex(-1);
|
|
22482
|
+
} else {
|
|
22483
|
+
changeFocusedOptionIndex(event, findLastOptionIndex());
|
|
22484
|
+
!overlayVisibleState && show();
|
|
22267
22485
|
}
|
|
22268
|
-
|
|
22486
|
+
event.preventDefault();
|
|
22269
22487
|
};
|
|
22270
|
-
var
|
|
22271
|
-
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
22279
|
-
|
|
22280
|
-
|
|
22488
|
+
var onPageUpKey = function onPageUpKey(event) {
|
|
22489
|
+
event.preventDefault();
|
|
22490
|
+
};
|
|
22491
|
+
var onPageDownKey = function onPageDownKey(event) {
|
|
22492
|
+
event.preventDefault();
|
|
22493
|
+
};
|
|
22494
|
+
var onSpaceKey = function onSpaceKey(event) {
|
|
22495
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22496
|
+
!pressedInInputText && onEnterKey(event);
|
|
22497
|
+
};
|
|
22498
|
+
var onEnterKey = function onEnterKey(event) {
|
|
22499
|
+
if (!overlayVisibleState) {
|
|
22500
|
+
setFocusedOptionIndex(-1);
|
|
22501
|
+
onArrowDownKey(event);
|
|
22502
|
+
} else {
|
|
22503
|
+
if (focusedOptionIndex !== -1) {
|
|
22504
|
+
onOptionSelect(event, visibleOptions[focusedOptionIndex]);
|
|
22281
22505
|
}
|
|
22506
|
+
hide();
|
|
22282
22507
|
}
|
|
22283
|
-
|
|
22284
|
-
|
|
22285
|
-
|
|
22286
|
-
|
|
22287
|
-
|
|
22508
|
+
event.preventDefault();
|
|
22509
|
+
};
|
|
22510
|
+
var onEscapeKey = function onEscapeKey(event) {
|
|
22511
|
+
overlayVisibleState && hide();
|
|
22512
|
+
event.preventDefault();
|
|
22513
|
+
};
|
|
22514
|
+
var onTabKey = function onTabKey(event) {
|
|
22515
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22516
|
+
if (!pressedInInputText) {
|
|
22517
|
+
if (overlayVisibleState && hasFocusableElements()) {
|
|
22518
|
+
DomHandler.focus($refs.firstHiddenFocusableElementOnOverlay);
|
|
22519
|
+
event.preventDefault();
|
|
22520
|
+
} else {
|
|
22521
|
+
if (focusedOptionIndex !== -1) {
|
|
22522
|
+
onOptionSelect(event, visibleOptions[focusedOptionIndex]);
|
|
22288
22523
|
}
|
|
22524
|
+
overlayVisibleState && hide();
|
|
22289
22525
|
}
|
|
22290
22526
|
}
|
|
22291
|
-
return null;
|
|
22292
22527
|
};
|
|
22293
|
-
var
|
|
22294
|
-
var
|
|
22295
|
-
if (
|
|
22296
|
-
|
|
22528
|
+
var onBackspaceKey = function onBackspaceKey(event) {
|
|
22529
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22530
|
+
if (pressedInInputText) {
|
|
22531
|
+
!overlayVisibleState && show();
|
|
22297
22532
|
}
|
|
22298
|
-
label = label.toLocaleLowerCase(props.filterLocale);
|
|
22299
|
-
return label.startsWith(searchValue.current.toLocaleLowerCase(props.filterLocale));
|
|
22300
22533
|
};
|
|
22301
22534
|
var onEditableInputChange = function onEditableInputChange(event) {
|
|
22535
|
+
!overlayVisibleState && show();
|
|
22536
|
+
var searchIndex = null;
|
|
22537
|
+
if (event.target.value) {
|
|
22538
|
+
searchIndex = visibleOptions.findIndex(function (item) {
|
|
22539
|
+
return item.name.toLocaleLowerCase().startsWith(event.target.value.toLocaleLowerCase());
|
|
22540
|
+
});
|
|
22541
|
+
}
|
|
22542
|
+
setFocusedOptionIndex(searchIndex);
|
|
22302
22543
|
if (props.onChange) {
|
|
22303
22544
|
props.onChange({
|
|
22304
22545
|
originalEvent: event.originalEvent,
|
|
@@ -22428,10 +22669,17 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22428
22669
|
return ObjectUtils.equals(props.value, getOptionValue(option), equalityKey());
|
|
22429
22670
|
};
|
|
22430
22671
|
var show = function show() {
|
|
22672
|
+
setFocusedOptionIndex(focusedOptionIndex !== -1 ? focusedOptionIndex : props.autoOptionFocus ? findFirstFocusedOptionIndex() : props.editable ? -1 : findSelectedOptionIndex());
|
|
22431
22673
|
setOverlayVisibleState(true);
|
|
22432
22674
|
};
|
|
22433
22675
|
var hide = function hide() {
|
|
22434
22676
|
setOverlayVisibleState(false);
|
|
22677
|
+
setClicked(false);
|
|
22678
|
+
};
|
|
22679
|
+
var onFocus = function onFocus() {
|
|
22680
|
+
if (props.editable) {
|
|
22681
|
+
DomHandler.focus(inputRef.current);
|
|
22682
|
+
}
|
|
22435
22683
|
};
|
|
22436
22684
|
var onOverlayEnter = function onOverlayEnter(callback) {
|
|
22437
22685
|
ZIndexUtils.set('overlay', overlayRef.current, context && context.autoZIndex || PrimeReact.autoZIndex, context && context.zIndex['overlay'] || PrimeReact.zIndex['overlay']);
|
|
@@ -22484,6 +22732,9 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22484
22732
|
var getOptionRenderKey = function getOptionRenderKey(option) {
|
|
22485
22733
|
return props.dataKey ? ObjectUtils.resolveFieldData(option, props.dataKey) : getOptionLabel(option);
|
|
22486
22734
|
};
|
|
22735
|
+
var isOptionGroup = function isOptionGroup(option) {
|
|
22736
|
+
return props.optionGroupLabel && option.optionGroup && option.group;
|
|
22737
|
+
};
|
|
22487
22738
|
var isOptionDisabled = function isOptionDisabled(option) {
|
|
22488
22739
|
if (props.optionDisabled) {
|
|
22489
22740
|
return ObjectUtils.isFunction(props.optionDisabled) ? props.optionDisabled(option) : ObjectUtils.resolveFieldData(option, props.optionDisabled);
|
|
@@ -22632,8 +22883,9 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22632
22883
|
maxLength: props.maxLength,
|
|
22633
22884
|
onInput: onEditableInputChange,
|
|
22634
22885
|
onFocus: onEditableInputFocus,
|
|
22886
|
+
onKeyDown: onInputKeyDown,
|
|
22635
22887
|
onBlur: onInputBlur,
|
|
22636
|
-
tabIndex: props.tabIndex
|
|
22888
|
+
tabIndex: !props.disabled ? props.tabIndex : -1,
|
|
22637
22889
|
'aria-haspopup': 'listbox'
|
|
22638
22890
|
}, ariaProps), ptm('input'));
|
|
22639
22891
|
return /*#__PURE__*/React.createElement("input", inputProps);
|
|
@@ -22725,10 +22977,31 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22725
22977
|
},
|
|
22726
22978
|
onMouseDown: props.onMouseDown,
|
|
22727
22979
|
onContextMenu: props.onContextMenu,
|
|
22980
|
+
onFocus: onFocus,
|
|
22728
22981
|
'data-p-disabled': props.disabled,
|
|
22729
22982
|
'data-p-focus': focusedState
|
|
22730
22983
|
}, otherProps, ptm('root'));
|
|
22731
|
-
|
|
22984
|
+
var firstHiddenFocusableElementProps = mergeProps({
|
|
22985
|
+
ref: firstHiddenFocusableElementOnOverlay,
|
|
22986
|
+
role: 'presentation',
|
|
22987
|
+
'aria-hidden': 'true',
|
|
22988
|
+
className: 'p-hidden-accessible p-hidden-focusable',
|
|
22989
|
+
tabIndex: '0',
|
|
22990
|
+
onFocus: onFirstHiddenFocus,
|
|
22991
|
+
'data-p-hidden-accessible': true,
|
|
22992
|
+
'data-p-hidden-focusable': true
|
|
22993
|
+
}, ptm('hiddenFirstFocusableEl'));
|
|
22994
|
+
var lastHiddenFocusableElementProps = mergeProps({
|
|
22995
|
+
ref: lastHiddenFocusableElementOnOverlay,
|
|
22996
|
+
role: 'presentation',
|
|
22997
|
+
'aria-hidden': 'true',
|
|
22998
|
+
className: 'p-hidden-accessible p-hidden-focusable',
|
|
22999
|
+
tabIndex: '0',
|
|
23000
|
+
onFocus: onLastHiddenFocus,
|
|
23001
|
+
'data-p-hidden-accessible': true,
|
|
23002
|
+
'data-p-hidden-focusable': true
|
|
23003
|
+
}, ptm('hiddenLastFocusableEl'));
|
|
23004
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", rootProps, keyboardHelper, hiddenSelect, labelElement, clearIcon, dropdownIcon, /*#__PURE__*/React.createElement("span", firstHiddenFocusableElementProps), /*#__PURE__*/React.createElement(DropdownPanel, _extends({
|
|
22732
23005
|
hostName: "Dropdown",
|
|
22733
23006
|
ref: overlayRef,
|
|
22734
23007
|
visibleOptions: visibleOptions,
|
|
@@ -22737,6 +23010,8 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22737
23010
|
appendTo: appendTo,
|
|
22738
23011
|
onClick: onPanelClick,
|
|
22739
23012
|
onOptionClick: onOptionClick,
|
|
23013
|
+
focusedOptionIndex: focusedOptionIndex,
|
|
23014
|
+
setFocusedOptionIndex: setFocusedOptionIndex,
|
|
22740
23015
|
filterValue: filterState,
|
|
22741
23016
|
hasFilter: hasFilter,
|
|
22742
23017
|
onFilterClearIconClick: onFilterClearIconClick,
|
|
@@ -22759,7 +23034,7 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
22759
23034
|
ptm: ptm,
|
|
22760
23035
|
cx: cx,
|
|
22761
23036
|
sx: sx
|
|
22762
|
-
}))), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
23037
|
+
})), /*#__PURE__*/React.createElement("span", lastHiddenFocusableElementProps)), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
22763
23038
|
target: elementRef,
|
|
22764
23039
|
content: props.tooltip
|
|
22765
23040
|
}, props.tooltipOptions, {
|
|
@@ -22780,7 +23055,7 @@ var RowsPerPageDropdown = /*#__PURE__*/React.memo(function (inProps) {
|
|
|
22780
23055
|
};
|
|
22781
23056
|
}) : [];
|
|
22782
23057
|
var placeholderValue = localeOption('choose');
|
|
22783
|
-
var ariaLabelValue = ariaLabel
|
|
23058
|
+
var ariaLabelValue = ariaLabel('jumpToPageDropdownLabel');
|
|
22784
23059
|
var element = hasOptions ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
22785
23060
|
value: props.value,
|
|
22786
23061
|
options: options,
|
|
@@ -24215,7 +24490,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
24215
24490
|
if (showSelection) {
|
|
24216
24491
|
var ariaLabelField = props.selectionAriaLabel || props.tableProps.dataKey;
|
|
24217
24492
|
var ariaLabelText = ObjectUtils.resolveFieldData(props.rowData, ariaLabelField);
|
|
24218
|
-
label = "".concat(props.selected ? ariaLabel
|
|
24493
|
+
label = "".concat(props.selected ? ariaLabel('unselectLabel') : ariaLabel('selectLabel'), " ").concat(ariaLabelText);
|
|
24219
24494
|
}
|
|
24220
24495
|
content = showSelection && /*#__PURE__*/React.createElement(React.Fragment, null, selectionMode === 'single' && /*#__PURE__*/React.createElement(RowRadioButton, {
|
|
24221
24496
|
hostName: props.hostName,
|
|
@@ -24270,7 +24545,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
24270
24545
|
var ariaControls = "".concat(props.tableSelector, "_content_").concat(props.rowIndex, "_expanded");
|
|
24271
24546
|
var _ariaLabelField = props.selectionAriaLabel || props.tableProps.dataKey;
|
|
24272
24547
|
var _ariaLabelText = ObjectUtils.resolveFieldData(props.rowData, _ariaLabelField);
|
|
24273
|
-
var _label = "".concat(props.expanded ? ariaLabel
|
|
24548
|
+
var _label = "".concat(props.expanded ? ariaLabel('collapseLabel') : ariaLabel('expandLabel'), " ").concat(_ariaLabelText);
|
|
24274
24549
|
var expanderProps = {
|
|
24275
24550
|
onClick: onRowToggle,
|
|
24276
24551
|
className: cx('rowToggler')
|
|
@@ -24325,19 +24600,19 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
24325
24600
|
var rowEditorSaveButtonProps = mergeProps(_defineProperty(_defineProperty({
|
|
24326
24601
|
type: 'button',
|
|
24327
24602
|
name: 'row-save',
|
|
24328
|
-
'aria-label': ariaLabel
|
|
24603
|
+
'aria-label': ariaLabel('saveEdit'),
|
|
24329
24604
|
onClick: rowEditorProps.onSaveClick,
|
|
24330
24605
|
className: rowEditorProps.saveClassName,
|
|
24331
24606
|
tabIndex: props.tabIndex
|
|
24332
|
-
}, "aria-label", ariaLabel
|
|
24607
|
+
}, "aria-label", ariaLabel('saveEdit')), 'data-p-row-editor-save', true), getColumnPTOptions('rowEditorSaveButton'));
|
|
24333
24608
|
var rowEditorCancelButtonProps = mergeProps(_defineProperty({
|
|
24334
24609
|
type: 'button',
|
|
24335
24610
|
name: 'row-cancel',
|
|
24336
|
-
'aria-label': ariaLabel
|
|
24611
|
+
'aria-label': ariaLabel('cancelEdit'),
|
|
24337
24612
|
onClick: rowEditorProps.onCancelClick,
|
|
24338
24613
|
className: rowEditorProps.cancelClassName,
|
|
24339
24614
|
tabIndex: props.tabIndex
|
|
24340
|
-
}, "aria-label", ariaLabel
|
|
24615
|
+
}, "aria-label", ariaLabel('cancelEdit')), getColumnPTOptions('rowEditorCancelButton'));
|
|
24341
24616
|
content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", rowEditorSaveButtonProps, rowEditorSaveIcon, /*#__PURE__*/React.createElement(Ripple, null)), /*#__PURE__*/React.createElement("button", rowEditorCancelButtonProps, rowEditorCancelIcon, /*#__PURE__*/React.createElement(Ripple, null)));
|
|
24342
24617
|
} else {
|
|
24343
24618
|
rowEditorProps = {
|
|
@@ -24348,11 +24623,11 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
24348
24623
|
var rowEditorInitButtonProps = mergeProps(_defineProperty(_defineProperty({
|
|
24349
24624
|
type: 'button',
|
|
24350
24625
|
name: 'row-edit',
|
|
24351
|
-
'aria-label': ariaLabel
|
|
24626
|
+
'aria-label': ariaLabel('editRow'),
|
|
24352
24627
|
onClick: rowEditorProps.onInitClick,
|
|
24353
24628
|
className: rowEditorProps.initClassName,
|
|
24354
24629
|
tabIndex: props.tabIndex
|
|
24355
|
-
}, "aria-label", ariaLabel
|
|
24630
|
+
}, "aria-label", ariaLabel('editRow')), 'data-p-row-editor-init', true), getColumnPTOptions('rowEditorInitButton'));
|
|
24356
24631
|
content = /*#__PURE__*/React.createElement("button", rowEditorInitButtonProps, rowEditorInitIcon, /*#__PURE__*/React.createElement(Ripple, null));
|
|
24357
24632
|
}
|
|
24358
24633
|
if (body) {
|
|
@@ -24999,7 +25274,7 @@ var RowTogglerButton = /*#__PURE__*/React.memo(function (props) {
|
|
|
24999
25274
|
var togglerIcon = IconUtils.getJSXIcon(icon, _objectSpread$19({}, rowGroupTogglerIconProps), {
|
|
25000
25275
|
props: props
|
|
25001
25276
|
});
|
|
25002
|
-
var label = props.expanded ? ariaLabel
|
|
25277
|
+
var label = props.expanded ? ariaLabel('collapseLabel') : ariaLabel('expandLabel');
|
|
25003
25278
|
var rowGroupTogglerProps = mergeProps({
|
|
25004
25279
|
type: 'button',
|
|
25005
25280
|
onClick: function onClick(e) {
|
|
@@ -26845,7 +27120,7 @@ var ColumnFilter = /*#__PURE__*/React.memo(function (props) {
|
|
|
26845
27120
|
var columnFilterIcon = IconUtils.getJSXIcon(icon, _objectSpread$15({}, filterIconProps), {
|
|
26846
27121
|
props: props
|
|
26847
27122
|
});
|
|
26848
|
-
var label = overlayVisibleState ? ariaLabel
|
|
27123
|
+
var label = overlayVisibleState ? ariaLabel('hideFilterMenu') : ariaLabel('showFilterMenu');
|
|
26849
27124
|
var filterMenuButtonProps = mergeProps({
|
|
26850
27125
|
type: 'button',
|
|
26851
27126
|
className: cx('filterMenuButton', {
|
|
@@ -26968,7 +27243,7 @@ var ColumnFilter = /*#__PURE__*/React.memo(function (props) {
|
|
|
26968
27243
|
__parentMetadata: {
|
|
26969
27244
|
parent: props.metaData
|
|
26970
27245
|
},
|
|
26971
|
-
"aria-label": ariaLabel
|
|
27246
|
+
"aria-label": ariaLabel('filterOperator')
|
|
26972
27247
|
}));
|
|
26973
27248
|
}
|
|
26974
27249
|
return null;
|
|
@@ -26988,7 +27263,7 @@ var ColumnFilter = /*#__PURE__*/React.memo(function (props) {
|
|
|
26988
27263
|
__parentMetadata: {
|
|
26989
27264
|
parent: props.metaData
|
|
26990
27265
|
},
|
|
26991
|
-
"aria-label": ariaLabel
|
|
27266
|
+
"aria-label": ariaLabel('filterConstraint')
|
|
26992
27267
|
});
|
|
26993
27268
|
}
|
|
26994
27269
|
return null;
|
|
@@ -27259,7 +27534,7 @@ var HeaderCheckbox = /*#__PURE__*/React.memo(function (props) {
|
|
|
27259
27534
|
}),
|
|
27260
27535
|
role: 'checkbox',
|
|
27261
27536
|
'aria-checked': props.checked,
|
|
27262
|
-
'aria-label': props.checked ? ariaLabel
|
|
27537
|
+
'aria-label': props.checked ? ariaLabel('selectAll') : ariaLabel('unselectAll'),
|
|
27263
27538
|
tabIndex: tabIndex,
|
|
27264
27539
|
onFocus: function onFocus(e) {
|
|
27265
27540
|
return _onFocus();
|
|
@@ -34738,7 +35013,9 @@ var InputSwitch = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
34738
35013
|
style: props.style,
|
|
34739
35014
|
onClick: onClick,
|
|
34740
35015
|
role: 'checkbox',
|
|
34741
|
-
'aria-checked': checked
|
|
35016
|
+
'aria-checked': checked,
|
|
35017
|
+
'data-p-highlight': checked,
|
|
35018
|
+
'data-p-disabled': props.disabled
|
|
34742
35019
|
}, otherProps, ptm('root'));
|
|
34743
35020
|
var hiddenInputWrapperProps = mergeProps({
|
|
34744
35021
|
className: 'p-hidden-accessible'
|
|
@@ -34939,6 +35216,7 @@ var KnobBase = ComponentBase.extend({
|
|
|
34939
35216
|
disabled: false,
|
|
34940
35217
|
readOnly: false,
|
|
34941
35218
|
showValue: true,
|
|
35219
|
+
tabIndex: 0,
|
|
34942
35220
|
step: 1,
|
|
34943
35221
|
min: 0,
|
|
34944
35222
|
max: 100,
|
|
@@ -35102,6 +35380,15 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
35102
35380
|
});
|
|
35103
35381
|
}
|
|
35104
35382
|
};
|
|
35383
|
+
var updateModelValue = function updateModelValue(newValue) {
|
|
35384
|
+
var currentValue;
|
|
35385
|
+
if (newValue > props.max) currentValue = props.max;else if (newValue < props.min) currentValue = props.min;else currentValue = newValue;
|
|
35386
|
+
if (props.onChange) {
|
|
35387
|
+
props.onChange({
|
|
35388
|
+
value: currentValue
|
|
35389
|
+
});
|
|
35390
|
+
}
|
|
35391
|
+
};
|
|
35105
35392
|
var _onClick = function onClick(event) {
|
|
35106
35393
|
if (!props.disabled && !props.readOnly) {
|
|
35107
35394
|
updateValue(event.nativeEvent.offsetX, event.nativeEvent.offsetY);
|
|
@@ -35124,6 +35411,48 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
35124
35411
|
unbindWindowTouchMoveListener();
|
|
35125
35412
|
unbindWindowTouchEndListener();
|
|
35126
35413
|
};
|
|
35414
|
+
var _onKeyDown = function onKeyDown(event) {
|
|
35415
|
+
if (!props.disabled && !props.readonly) {
|
|
35416
|
+
switch (event.code) {
|
|
35417
|
+
case 'ArrowRight':
|
|
35418
|
+
case 'ArrowUp':
|
|
35419
|
+
event.preventDefault();
|
|
35420
|
+
updateModelValue(props.value + 1);
|
|
35421
|
+
break;
|
|
35422
|
+
case 'ArrowLeft':
|
|
35423
|
+
case 'ArrowDown':
|
|
35424
|
+
{
|
|
35425
|
+
event.preventDefault();
|
|
35426
|
+
updateModelValue(props.value - 1);
|
|
35427
|
+
break;
|
|
35428
|
+
}
|
|
35429
|
+
case 'Home':
|
|
35430
|
+
{
|
|
35431
|
+
event.preventDefault();
|
|
35432
|
+
updateModelValue(props.min);
|
|
35433
|
+
break;
|
|
35434
|
+
}
|
|
35435
|
+
case 'End':
|
|
35436
|
+
{
|
|
35437
|
+
event.preventDefault();
|
|
35438
|
+
updateModelValue(props.max);
|
|
35439
|
+
break;
|
|
35440
|
+
}
|
|
35441
|
+
case 'PageUp':
|
|
35442
|
+
{
|
|
35443
|
+
event.preventDefault();
|
|
35444
|
+
updateModelValue(props.value + 10);
|
|
35445
|
+
break;
|
|
35446
|
+
}
|
|
35447
|
+
case 'PageDown':
|
|
35448
|
+
{
|
|
35449
|
+
event.preventDefault();
|
|
35450
|
+
updateModelValue(props.value - 10);
|
|
35451
|
+
break;
|
|
35452
|
+
}
|
|
35453
|
+
}
|
|
35454
|
+
}
|
|
35455
|
+
};
|
|
35127
35456
|
React.useImperativeHandle(ref, function () {
|
|
35128
35457
|
return {
|
|
35129
35458
|
props: props,
|
|
@@ -35151,6 +35480,13 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
35151
35480
|
viewBox: '0 0 100 100',
|
|
35152
35481
|
width: props.size,
|
|
35153
35482
|
height: props.size,
|
|
35483
|
+
'aria-valuemin': props.min,
|
|
35484
|
+
'aria-valuemax': props.max,
|
|
35485
|
+
'aria-valuenow': props.value,
|
|
35486
|
+
'aria-labelledby': props.ariaLabelledby,
|
|
35487
|
+
'aria-label': props.ariaLabel,
|
|
35488
|
+
role: 'slider',
|
|
35489
|
+
tabIndex: props.readonly || props.disabled ? -1 : props.tabIndex,
|
|
35154
35490
|
onClick: function onClick(e) {
|
|
35155
35491
|
return _onClick(e);
|
|
35156
35492
|
},
|
|
@@ -35165,6 +35501,9 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
35165
35501
|
},
|
|
35166
35502
|
onTouchEnd: function onTouchEnd(e) {
|
|
35167
35503
|
return _onTouchEnd();
|
|
35504
|
+
},
|
|
35505
|
+
onKeyDown: function onKeyDown(e) {
|
|
35506
|
+
return _onKeyDown(e);
|
|
35168
35507
|
}
|
|
35169
35508
|
}, ptm('svg'));
|
|
35170
35509
|
var rangeProps = mergeProps({
|
|
@@ -35183,28 +35522,26 @@ var Knob = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
35183
35522
|
}));
|
|
35184
35523
|
Knob.displayName = 'Knob';
|
|
35185
35524
|
|
|
35525
|
+
var _defaultProps;
|
|
35186
35526
|
var classes$A = {
|
|
35187
35527
|
itemGroup: 'p-listbox-item-group',
|
|
35188
35528
|
emptyMessage: 'p-listbox-empty-message',
|
|
35189
|
-
list:
|
|
35190
|
-
|
|
35191
|
-
|
|
35192
|
-
return props.virtualScrollerOptions ? classNames('p-listbox-list', options.className) : 'p-listbox-list';
|
|
35193
|
-
},
|
|
35194
|
-
wrapper: function wrapper(_ref2) {
|
|
35195
|
-
var props = _ref2.props;
|
|
35529
|
+
list: 'p-listbox-list',
|
|
35530
|
+
wrapper: function wrapper(_ref) {
|
|
35531
|
+
var props = _ref.props;
|
|
35196
35532
|
return classNames('p-listbox-list-wrapper', props.listClassName);
|
|
35197
35533
|
},
|
|
35198
|
-
root: function root(
|
|
35199
|
-
var props =
|
|
35534
|
+
root: function root(_ref2) {
|
|
35535
|
+
var props = _ref2.props;
|
|
35200
35536
|
return classNames('p-listbox p-component', {
|
|
35201
35537
|
'p-disabled': props.disabled
|
|
35202
35538
|
}, props.className);
|
|
35203
35539
|
},
|
|
35204
|
-
item: function item(
|
|
35205
|
-
var props =
|
|
35540
|
+
item: function item(_ref3) {
|
|
35541
|
+
var props = _ref3.props;
|
|
35206
35542
|
return classNames('p-listbox-item', {
|
|
35207
35543
|
'p-highlight': props.selected,
|
|
35544
|
+
'p-focus': props.focusedOptionIndex === props.index,
|
|
35208
35545
|
'p-disabled': props.disabled
|
|
35209
35546
|
}, props.option.className);
|
|
35210
35547
|
},
|
|
@@ -35213,22 +35550,22 @@ var classes$A = {
|
|
|
35213
35550
|
filterInput: 'p-listbox-filter',
|
|
35214
35551
|
header: 'p-listbox-header'
|
|
35215
35552
|
};
|
|
35216
|
-
var styles$w = "\n@layer primereact {\n .p-listbox-list-wrapper {\n overflow: auto;\n }\n \n .p-listbox-list {\n list-style-type: none;\n margin: 0;\n padding: 0;\n }\n \n .p-listbox-item {\n cursor: pointer;\n position: relative;\n overflow: hidden;\n }\n \n .p-listbox-filter-container {\n position: relative;\n }\n \n .p-listbox-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-listbox-filter {\n width: 100%;\n }\n}\n";
|
|
35553
|
+
var styles$w = "\n@layer primereact {\n .p-listbox-list-wrapper {\n overflow: auto;\n }\n \n .p-listbox-list {\n list-style-type: none;\n margin: 0;\n padding: 0;\n }\n \n .p-listbox-item {\n cursor: pointer;\n position: relative;\n overflow: hidden;\n outline: none;\n }\n \n .p-listbox-filter-container {\n position: relative;\n }\n \n .p-listbox-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-listbox-filter {\n width: 100%;\n }\n}\n";
|
|
35217
35554
|
var inlineStyles$c = {
|
|
35218
|
-
itemGroup: function itemGroup(
|
|
35219
|
-
var scrollerOptions =
|
|
35555
|
+
itemGroup: function itemGroup(_ref4) {
|
|
35556
|
+
var scrollerOptions = _ref4.scrollerOptions;
|
|
35220
35557
|
return {
|
|
35221
35558
|
height: scrollerOptions.props ? scrollerOptions.props.itemSize : undefined
|
|
35222
35559
|
};
|
|
35223
35560
|
},
|
|
35224
|
-
list: function list(
|
|
35225
|
-
var options =
|
|
35226
|
-
props =
|
|
35561
|
+
list: function list(_ref5) {
|
|
35562
|
+
var options = _ref5.options,
|
|
35563
|
+
props = _ref5.props;
|
|
35227
35564
|
return props.virtualScrollerOptions ? options.style : undefined;
|
|
35228
35565
|
}
|
|
35229
35566
|
};
|
|
35230
35567
|
var ListBoxBase = ComponentBase.extend({
|
|
35231
|
-
defaultProps: {
|
|
35568
|
+
defaultProps: (_defaultProps = {
|
|
35232
35569
|
__TYPE: 'ListBox',
|
|
35233
35570
|
className: null,
|
|
35234
35571
|
dataKey: null,
|
|
@@ -35244,29 +35581,13 @@ var ListBoxBase = ComponentBase.extend({
|
|
|
35244
35581
|
filterPlaceholder: null,
|
|
35245
35582
|
filterTemplate: null,
|
|
35246
35583
|
filterValue: null,
|
|
35584
|
+
selectOnFocus: false,
|
|
35247
35585
|
id: null,
|
|
35248
35586
|
itemTemplate: null,
|
|
35249
35587
|
listClassName: null,
|
|
35250
35588
|
listStyle: null,
|
|
35251
|
-
metaKeySelection: false
|
|
35252
|
-
|
|
35253
|
-
onChange: null,
|
|
35254
|
-
onFilterValueChange: null,
|
|
35255
|
-
optionDisabled: null,
|
|
35256
|
-
optionGroupChildren: null,
|
|
35257
|
-
optionGroupLabel: null,
|
|
35258
|
-
optionGroupTemplate: null,
|
|
35259
|
-
optionLabel: null,
|
|
35260
|
-
optionValue: null,
|
|
35261
|
-
options: null,
|
|
35262
|
-
style: null,
|
|
35263
|
-
tabIndex: 0,
|
|
35264
|
-
tooltip: null,
|
|
35265
|
-
tooltipOptions: null,
|
|
35266
|
-
value: null,
|
|
35267
|
-
virtualScrollerOptions: null,
|
|
35268
|
-
children: undefined
|
|
35269
|
-
},
|
|
35589
|
+
metaKeySelection: false
|
|
35590
|
+
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defaultProps, "selectOnFocus", false), "autoOptionFocus", true), "multiple", false), "onChange", null), "onFilterValueChange", null), "optionDisabled", null), "optionGroupChildren", null), "optionGroupLabel", null), "optionGroupTemplate", null), "optionLabel", null), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defaultProps, "optionValue", null), "options", null), "style", null), "tabIndex", 0), "tooltip", null), "tooltipOptions", null), "value", null), "virtualScrollerOptions", null), "children", undefined)),
|
|
35270
35591
|
css: {
|
|
35271
35592
|
classes: classes$A,
|
|
35272
35593
|
styles: styles$w,
|
|
@@ -35363,7 +35684,8 @@ var ListBoxItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
35363
35684
|
context: {
|
|
35364
35685
|
selected: props.selected,
|
|
35365
35686
|
disabled: props.disabled,
|
|
35366
|
-
focused: focusedState
|
|
35687
|
+
focused: focusedState,
|
|
35688
|
+
focusedOptionIndex: props.focusedOptionIndex
|
|
35367
35689
|
}
|
|
35368
35690
|
});
|
|
35369
35691
|
};
|
|
@@ -35373,15 +35695,6 @@ var ListBoxItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
35373
35695
|
var onBlur = function onBlur(event) {
|
|
35374
35696
|
setFocusedState(false);
|
|
35375
35697
|
};
|
|
35376
|
-
var onClick = function onClick(event) {
|
|
35377
|
-
if (props.onClick) {
|
|
35378
|
-
props.onClick({
|
|
35379
|
-
originalEvent: event,
|
|
35380
|
-
option: props.option
|
|
35381
|
-
});
|
|
35382
|
-
}
|
|
35383
|
-
event.preventDefault();
|
|
35384
|
-
};
|
|
35385
35698
|
var onTouchEnd = function onTouchEnd(event) {
|
|
35386
35699
|
if (props.onTouchEnd) {
|
|
35387
35700
|
props.onTouchEnd({
|
|
@@ -35390,47 +35703,17 @@ var ListBoxItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
35390
35703
|
});
|
|
35391
35704
|
}
|
|
35392
35705
|
};
|
|
35393
|
-
var onKeyDown = function onKeyDown(event) {
|
|
35394
|
-
var item = event.currentTarget;
|
|
35395
|
-
switch (event.which) {
|
|
35396
|
-
//down
|
|
35397
|
-
case 40:
|
|
35398
|
-
var nextItem = findNextItem(item);
|
|
35399
|
-
nextItem && nextItem.focus();
|
|
35400
|
-
event.preventDefault();
|
|
35401
|
-
break;
|
|
35402
|
-
|
|
35403
|
-
//up
|
|
35404
|
-
case 38:
|
|
35405
|
-
var prevItem = findPrevItem(item);
|
|
35406
|
-
prevItem && prevItem.focus();
|
|
35407
|
-
event.preventDefault();
|
|
35408
|
-
break;
|
|
35409
|
-
|
|
35410
|
-
//enter
|
|
35411
|
-
case 13:
|
|
35412
|
-
onClick(event);
|
|
35413
|
-
event.preventDefault();
|
|
35414
|
-
break;
|
|
35415
|
-
}
|
|
35416
|
-
};
|
|
35417
|
-
var findNextItem = function findNextItem(item) {
|
|
35418
|
-
var nextItem = item.nextElementSibling;
|
|
35419
|
-
return nextItem ? DomHandler.isAttributeEquals(nextItem, 'data-p-disabled', true) || DomHandler.isAttributeEquals(nextItem, 'data-pc-section', 'itemgroup') ? findNextItem(nextItem) : nextItem : null;
|
|
35420
|
-
};
|
|
35421
|
-
var findPrevItem = function findPrevItem(item) {
|
|
35422
|
-
var prevItem = item.previousElementSibling;
|
|
35423
|
-
return prevItem ? DomHandler.isAttributeEquals(prevItem, 'data-p-disabled', true) || DomHandler.isAttributeEquals(prevItem, 'data-pc-section', 'itemgroup') ? findPrevItem(prevItem) : prevItem : null;
|
|
35424
|
-
};
|
|
35425
35706
|
var content = props.template ? ObjectUtils.getJSXElement(props.template, props.option) : props.label;
|
|
35426
35707
|
var itemProps = mergeProps({
|
|
35708
|
+
id: props.id,
|
|
35427
35709
|
className: cx('item', {
|
|
35428
35710
|
props: props
|
|
35429
35711
|
}),
|
|
35430
35712
|
style: props.style,
|
|
35431
|
-
onClick: onClick
|
|
35713
|
+
onClick: function onClick(event) {
|
|
35714
|
+
return props.onClick(event, props.option, props.index);
|
|
35715
|
+
},
|
|
35432
35716
|
onTouchEnd: onTouchEnd,
|
|
35433
|
-
onKeyDown: onKeyDown,
|
|
35434
35717
|
onFocus: onFocus,
|
|
35435
35718
|
onBlur: onBlur,
|
|
35436
35719
|
tabIndex: '-1',
|
|
@@ -35454,12 +35737,25 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35454
35737
|
var mergeProps = useMergeProps();
|
|
35455
35738
|
var context = React.useContext(PrimeReactContext);
|
|
35456
35739
|
var props = ListBoxBase.getProps(inProps, context);
|
|
35457
|
-
var _React$useState = React.useState(
|
|
35740
|
+
var _React$useState = React.useState(null),
|
|
35458
35741
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
35459
|
-
|
|
35460
|
-
|
|
35742
|
+
focusedOptionIndex = _React$useState2[0],
|
|
35743
|
+
setFocusedOptionIndex = _React$useState2[1];
|
|
35744
|
+
var searchTimeout = React.useRef(null);
|
|
35745
|
+
var firstHiddenFocusableElement = React.useRef(null);
|
|
35746
|
+
var lastHiddenFocusableElement = React.useRef(null);
|
|
35747
|
+
var _React$useState3 = React.useState(-1),
|
|
35748
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
35749
|
+
startRangeIndex = _React$useState4[0],
|
|
35750
|
+
setStartRangeIndex = _React$useState4[1];
|
|
35751
|
+
var _React$useState5 = React.useState(''),
|
|
35752
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
35753
|
+
filterValueState = _React$useState6[0],
|
|
35754
|
+
setFilterValueState = _React$useState6[1];
|
|
35461
35755
|
var elementRef = React.useRef(null);
|
|
35462
35756
|
var virtualScrollerRef = React.useRef(null);
|
|
35757
|
+
var id = React.useRef(UniqueComponentId());
|
|
35758
|
+
var listRef = React.useRef(null);
|
|
35463
35759
|
var optionTouched = React.useRef(false);
|
|
35464
35760
|
var filteredValue = (props.onFilterValueChange ? props.filterValue : filterValueState) || '';
|
|
35465
35761
|
var hasFilter = filteredValue && filteredValue.trim().length > 0;
|
|
@@ -35473,13 +35769,14 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35473
35769
|
useHandleStyle(ListBoxBase.css.styles, ptCallbacks.isUnstyled, {
|
|
35474
35770
|
name: 'listbox'
|
|
35475
35771
|
});
|
|
35476
|
-
var onOptionSelect = function onOptionSelect(event) {
|
|
35477
|
-
var
|
|
35772
|
+
var onOptionSelect = function onOptionSelect(event, option) {
|
|
35773
|
+
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
35478
35774
|
if (props.disabled || isOptionDisabled(option)) {
|
|
35479
35775
|
return;
|
|
35480
35776
|
}
|
|
35481
35777
|
props.multiple ? onOptionSelectMultiple(event.originalEvent, option) : onOptionSelectSingle(event.originalEvent, option);
|
|
35482
35778
|
optionTouched.current = false;
|
|
35779
|
+
index !== -1 && setFocusedOptionIndex(index);
|
|
35483
35780
|
};
|
|
35484
35781
|
var onOptionTouchEnd = function onOptionTouchEnd() {
|
|
35485
35782
|
if (props.disabled) {
|
|
@@ -35548,6 +35845,269 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35548
35845
|
});
|
|
35549
35846
|
}
|
|
35550
35847
|
};
|
|
35848
|
+
var hasSelectedOption = function hasSelectedOption() {
|
|
35849
|
+
return ObjectUtils.isNotEmpty(props.value);
|
|
35850
|
+
};
|
|
35851
|
+
var isOptionGroup = function isOptionGroup(option) {
|
|
35852
|
+
return props.optionGroupLabel && option.optionGroup && option.group;
|
|
35853
|
+
};
|
|
35854
|
+
var isValidOption = function isValidOption(option) {
|
|
35855
|
+
return ObjectUtils.isNotEmpty(option) && !(isOptionDisabled(option) || isOptionGroup(option));
|
|
35856
|
+
};
|
|
35857
|
+
var isValidSelectedOption = function isValidSelectedOption(option) {
|
|
35858
|
+
return isValidOption(option) && isSelected(option);
|
|
35859
|
+
};
|
|
35860
|
+
var findFirstOptionIndex = function findFirstOptionIndex() {
|
|
35861
|
+
return visibleOptions.findIndex(function (option) {
|
|
35862
|
+
return isValidOption(option);
|
|
35863
|
+
});
|
|
35864
|
+
};
|
|
35865
|
+
var findLastOptionIndex = function findLastOptionIndex() {
|
|
35866
|
+
return ObjectUtils.findLastIndex(visibleOptions, function (option) {
|
|
35867
|
+
return isValidOption(option);
|
|
35868
|
+
});
|
|
35869
|
+
};
|
|
35870
|
+
var findNextOptionIndex = function findNextOptionIndex(index) {
|
|
35871
|
+
var matchedOptionIndex = index < visibleOptions.length - 1 ? visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
35872
|
+
return isValidOption(option);
|
|
35873
|
+
}) : -1;
|
|
35874
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
|
|
35875
|
+
};
|
|
35876
|
+
var findPrevOptionIndex = function findPrevOptionIndex(index) {
|
|
35877
|
+
var matchedOptionIndex = index > 0 ? ObjectUtils.findLastIndex(visibleOptions.slice(0, index), function (option) {
|
|
35878
|
+
return isValidOption(option);
|
|
35879
|
+
}) : -1;
|
|
35880
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
35881
|
+
};
|
|
35882
|
+
var focusedOptionId = function focusedOptionId() {
|
|
35883
|
+
return focusedOptionIndex !== -1 ? "".concat(id.current, "_").concat(focusedOptionIndex) : null;
|
|
35884
|
+
};
|
|
35885
|
+
var findNearestSelectedOptionIndex = function findNearestSelectedOptionIndex(index) {
|
|
35886
|
+
var firstCheckUp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
35887
|
+
var matchedOptionIndex = -1;
|
|
35888
|
+
if (hasSelectedOption) {
|
|
35889
|
+
if (firstCheckUp) {
|
|
35890
|
+
matchedOptionIndex = findPrevSelectedOptionIndex(index);
|
|
35891
|
+
matchedOptionIndex = matchedOptionIndex === -1 ? findNextSelectedOptionIndex(index) : matchedOptionIndex;
|
|
35892
|
+
} else {
|
|
35893
|
+
matchedOptionIndex = findNextSelectedOptionIndex(index);
|
|
35894
|
+
matchedOptionIndex = matchedOptionIndex === -1 ? findPrevSelectedOptionIndex(index) : matchedOptionIndex;
|
|
35895
|
+
}
|
|
35896
|
+
}
|
|
35897
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
35898
|
+
};
|
|
35899
|
+
var isOptionMatched = function isOptionMatched(option) {
|
|
35900
|
+
var _getOptionLabel;
|
|
35901
|
+
return isValidOption(option) && ((_getOptionLabel = getOptionLabel(option)) === null || _getOptionLabel === void 0 ? void 0 : _getOptionLabel.toLocaleLowerCase(props.filterLocale).startsWith(searchValue.toLocaleLowerCase(props.filterLocale)));
|
|
35902
|
+
};
|
|
35903
|
+
var searchOptions = function searchOptions(event, _char) {
|
|
35904
|
+
searchValue = (searchValue || '') + _char;
|
|
35905
|
+
var optionIndex = -1;
|
|
35906
|
+
if (ObjectUtils.isNotEmpty(searchValue)) {
|
|
35907
|
+
if (focusedOptionIndex !== -1) {
|
|
35908
|
+
optionIndex = visibleOptions.slice(focusedOptionIndex).findIndex(function (option) {
|
|
35909
|
+
return isOptionMatched(option);
|
|
35910
|
+
});
|
|
35911
|
+
optionIndex = optionIndex === -1 ? visibleOptions.slice(0, focusedOptionIndex).findIndex(function (option) {
|
|
35912
|
+
return isOptionMatched(option);
|
|
35913
|
+
}) : optionIndex + focusedOptionIndex;
|
|
35914
|
+
} else {
|
|
35915
|
+
optionIndex = visibleOptions.findIndex(function (option) {
|
|
35916
|
+
return isOptionMatched(option);
|
|
35917
|
+
});
|
|
35918
|
+
}
|
|
35919
|
+
if (optionIndex === -1 && focusedOptionIndex === -1) {
|
|
35920
|
+
optionIndex = findFirstFocusedOptionIndex();
|
|
35921
|
+
}
|
|
35922
|
+
if (optionIndex !== -1) {
|
|
35923
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
35924
|
+
}
|
|
35925
|
+
}
|
|
35926
|
+
if (searchTimeout.current) {
|
|
35927
|
+
clearTimeout(searchTimeout.current);
|
|
35928
|
+
}
|
|
35929
|
+
searchTimeout.current = setTimeout(function () {
|
|
35930
|
+
searchValue = '';
|
|
35931
|
+
searchTimeout.current = null;
|
|
35932
|
+
}, 500);
|
|
35933
|
+
};
|
|
35934
|
+
var findNextSelectedOptionIndex = function findNextSelectedOptionIndex(index) {
|
|
35935
|
+
var matchedOptionIndex = hasSelectedOption && index < visibleOptions.length - 1 ? visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
35936
|
+
return isValidSelectedOption(option);
|
|
35937
|
+
}) : -1;
|
|
35938
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : -1;
|
|
35939
|
+
};
|
|
35940
|
+
var findPrevSelectedOptionIndex = function findPrevSelectedOptionIndex(index) {
|
|
35941
|
+
var matchedOptionIndex = hasSelectedOption && index > 0 ? ObjectUtils.findLastIndex(visibleOptions.slice(0, index), function (option) {
|
|
35942
|
+
return isValidSelectedOption(option);
|
|
35943
|
+
}) : -1;
|
|
35944
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex : -1;
|
|
35945
|
+
};
|
|
35946
|
+
var onOptionSelectRange = function onOptionSelectRange(event) {
|
|
35947
|
+
var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
|
35948
|
+
var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
35949
|
+
start === -1 && (start = findNearestSelectedOptionIndex(end, true));
|
|
35950
|
+
end === -1 && (end = findNearestSelectedOptionIndex(start));
|
|
35951
|
+
if (start !== -1 && end !== -1) {
|
|
35952
|
+
var rangeStart = Math.min(start, end);
|
|
35953
|
+
var rangeEnd = Math.max(start, end);
|
|
35954
|
+
var value = visibleOptions.slice(rangeStart, rangeEnd + 1).filter(function (option) {
|
|
35955
|
+
return isValidOption(option);
|
|
35956
|
+
}).map(function (option) {
|
|
35957
|
+
return getOptionValue(option);
|
|
35958
|
+
});
|
|
35959
|
+
updateModel(event, value);
|
|
35960
|
+
}
|
|
35961
|
+
};
|
|
35962
|
+
var findFirstFocusedOptionIndex = function findFirstFocusedOptionIndex() {
|
|
35963
|
+
var selectedIndex = findFirstSelectedOptionIndex();
|
|
35964
|
+
return selectedIndex < 0 ? findFirstOptionIndex() : selectedIndex;
|
|
35965
|
+
};
|
|
35966
|
+
var changeFocusedOptionIndex = function changeFocusedOptionIndex(event, index) {
|
|
35967
|
+
if (focusedOptionIndex !== index) {
|
|
35968
|
+
setFocusedOptionIndex(index);
|
|
35969
|
+
scrollInView();
|
|
35970
|
+
if (props.selectOnFocus && !props.multiple) {
|
|
35971
|
+
onOptionSelect(event, visibleOptions[index]);
|
|
35972
|
+
}
|
|
35973
|
+
}
|
|
35974
|
+
};
|
|
35975
|
+
var onArrowDownKey = function onArrowDownKey(event) {
|
|
35976
|
+
var optionIndex = focusedOptionIndex !== -1 ? findNextOptionIndex(focusedOptionIndex) : findFirstFocusedOptionIndex();
|
|
35977
|
+
if (props.multiple && event.shiftKey) {
|
|
35978
|
+
onOptionSelectRange(event, startRangeIndex, optionIndex);
|
|
35979
|
+
}
|
|
35980
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
35981
|
+
event.preventDefault();
|
|
35982
|
+
};
|
|
35983
|
+
var onArrowUpKey = function onArrowUpKey(event) {
|
|
35984
|
+
var optionIndex = focusedOptionIndex !== -1 ? findPrevOptionIndex(focusedOptionIndex) : findLastFocusedOptionIndex();
|
|
35985
|
+
if (props.multiple && event.shiftKey) {
|
|
35986
|
+
onOptionSelectRange(event, optionIndex, startRangeIndex);
|
|
35987
|
+
}
|
|
35988
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
35989
|
+
event.preventDefault();
|
|
35990
|
+
};
|
|
35991
|
+
var onEnterKey = function onEnterKey(event) {
|
|
35992
|
+
if (focusedOptionIndex !== -1) {
|
|
35993
|
+
if (props.multiple && event.shiftKey) onOptionSelectRange(event, focusedOptionIndex);else onOptionSelect(event, visibleOptions[focusedOptionIndex]);
|
|
35994
|
+
}
|
|
35995
|
+
event.preventDefault();
|
|
35996
|
+
};
|
|
35997
|
+
var onSpaceKey = function onSpaceKey(event) {
|
|
35998
|
+
onEnterKey(event);
|
|
35999
|
+
};
|
|
36000
|
+
var onShiftKey = function onShiftKey() {
|
|
36001
|
+
setStartRangeIndex(focusedOptionIndex);
|
|
36002
|
+
};
|
|
36003
|
+
var onHomeKey = function onHomeKey(event) {
|
|
36004
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
36005
|
+
if (pressedInInputText) {
|
|
36006
|
+
event.currentTarget.setSelectionRange(0, 0);
|
|
36007
|
+
setFocusedOptionIndex(-1);
|
|
36008
|
+
} else {
|
|
36009
|
+
var metaKey = event.metaKey || event.ctrlKey;
|
|
36010
|
+
var optionIndex = findFirstOptionIndex();
|
|
36011
|
+
if (props.multiple && event.shiftKey && metaKey) {
|
|
36012
|
+
onOptionSelectRange(event, optionIndex, startRangeIndex);
|
|
36013
|
+
}
|
|
36014
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
36015
|
+
}
|
|
36016
|
+
event.preventDefault();
|
|
36017
|
+
};
|
|
36018
|
+
var onEndKey = function onEndKey(event) {
|
|
36019
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
36020
|
+
if (pressedInInputText) {
|
|
36021
|
+
var target = event.currentTarget;
|
|
36022
|
+
var len = target.value.length;
|
|
36023
|
+
target.setSelectionRange(len, len);
|
|
36024
|
+
_readOnlyError("focusedOptionIndex");
|
|
36025
|
+
} else {
|
|
36026
|
+
var metaKey = event.metaKey || event.ctrlKey;
|
|
36027
|
+
var optionIndex = findLastOptionIndex();
|
|
36028
|
+
if (props.multiple && event.shiftKey && metaKey) {
|
|
36029
|
+
onOptionSelectRange(event, startRangeIndex, optionIndex);
|
|
36030
|
+
}
|
|
36031
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
36032
|
+
}
|
|
36033
|
+
event.preventDefault();
|
|
36034
|
+
};
|
|
36035
|
+
var onPageUpKey = function onPageUpKey(event) {
|
|
36036
|
+
scrollInView(0);
|
|
36037
|
+
event.preventDefault();
|
|
36038
|
+
};
|
|
36039
|
+
var onPageDownKey = function onPageDownKey(event) {
|
|
36040
|
+
scrollInView(visibleOptions.length - 1);
|
|
36041
|
+
event.preventDefault();
|
|
36042
|
+
};
|
|
36043
|
+
var onKeyDown = function onKeyDown(event) {
|
|
36044
|
+
var metaKey = event.metaKey || event.ctrlKey;
|
|
36045
|
+
switch (event.code) {
|
|
36046
|
+
case 'ArrowDown':
|
|
36047
|
+
onArrowDownKey(event);
|
|
36048
|
+
break;
|
|
36049
|
+
case 'ArrowUp':
|
|
36050
|
+
onArrowUpKey(event);
|
|
36051
|
+
break;
|
|
36052
|
+
case 'Home':
|
|
36053
|
+
onHomeKey(event);
|
|
36054
|
+
break;
|
|
36055
|
+
case 'End':
|
|
36056
|
+
onEndKey(event);
|
|
36057
|
+
break;
|
|
36058
|
+
case 'PageDown':
|
|
36059
|
+
onPageDownKey(event);
|
|
36060
|
+
break;
|
|
36061
|
+
case 'PageUp':
|
|
36062
|
+
onPageUpKey(event);
|
|
36063
|
+
break;
|
|
36064
|
+
case 'Enter':
|
|
36065
|
+
case 'NumpadEnter':
|
|
36066
|
+
case 'Space':
|
|
36067
|
+
onSpaceKey(event);
|
|
36068
|
+
event.preventDefault();
|
|
36069
|
+
break;
|
|
36070
|
+
case 'Tab':
|
|
36071
|
+
//NOOP
|
|
36072
|
+
break;
|
|
36073
|
+
case 'ShiftLeft':
|
|
36074
|
+
case 'ShiftRight':
|
|
36075
|
+
onShiftKey();
|
|
36076
|
+
break;
|
|
36077
|
+
default:
|
|
36078
|
+
if (props.multiple && event.code === 'KeyA' && metaKey) {
|
|
36079
|
+
var value = visibleOptions.filter(function (option) {
|
|
36080
|
+
return isValidOption(option);
|
|
36081
|
+
}).map(function (option) {
|
|
36082
|
+
return getOptionValue(option);
|
|
36083
|
+
});
|
|
36084
|
+
updateModel(event, value);
|
|
36085
|
+
event.preventDefault();
|
|
36086
|
+
break;
|
|
36087
|
+
}
|
|
36088
|
+
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
|
36089
|
+
searchOptions(event, event.key);
|
|
36090
|
+
event.preventDefault();
|
|
36091
|
+
}
|
|
36092
|
+
break;
|
|
36093
|
+
}
|
|
36094
|
+
};
|
|
36095
|
+
var scrollInView = function scrollInView() {
|
|
36096
|
+
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
36097
|
+
setTimeout(function () {
|
|
36098
|
+
var idx = index !== -1 ? "".concat(id.current, "_").concat(index) : focusedOptionId();
|
|
36099
|
+
var element = listRef.current.querySelector("li[id=\"".concat(idx, "\"]"));
|
|
36100
|
+
if (element) {
|
|
36101
|
+
element.scrollIntoView({
|
|
36102
|
+
block: 'nearest',
|
|
36103
|
+
inline: 'nearest',
|
|
36104
|
+
behavior: 'smooth'
|
|
36105
|
+
});
|
|
36106
|
+
} else if (props.virtualScrollerOptions) {
|
|
36107
|
+
virtualScrollerRef.current && virtualScrollerRef.current.scrollToIndex(index !== -1 ? index : props.focusedOptionIndex);
|
|
36108
|
+
}
|
|
36109
|
+
}, 0);
|
|
36110
|
+
};
|
|
35551
36111
|
var onFilter = function onFilter(event) {
|
|
35552
36112
|
virtualScrollerRef.current && virtualScrollerRef.current.scrollToIndex(0);
|
|
35553
36113
|
var originalEvent = event.originalEvent,
|
|
@@ -35640,6 +36200,23 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35640
36200
|
}
|
|
35641
36201
|
return option && option['disabled'] !== undefined ? option['disabled'] : false;
|
|
35642
36202
|
};
|
|
36203
|
+
var onFirstHiddenFocus = function onFirstHiddenFocus() {
|
|
36204
|
+
DomHandler.focus(listRef.current);
|
|
36205
|
+
var firstFocusableEl = DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-p-hidden-focusable="true"])');
|
|
36206
|
+
lastHiddenFocusableElement.current.tabIndex = DomHandler.isElement(firstFocusableEl) ? undefined : -1;
|
|
36207
|
+
firstHiddenFocusableElement.current.tabIndex = -1;
|
|
36208
|
+
};
|
|
36209
|
+
var onLastHiddenFocus = function onLastHiddenFocus(event) {
|
|
36210
|
+
var relatedTarget = event.relatedTarget;
|
|
36211
|
+
if (relatedTarget === listRef.current) {
|
|
36212
|
+
var firstFocusableEl = DomHandler.getFirstFocusableElement(elementRef.current, ':not([data-p-hidden-focusable="true"])');
|
|
36213
|
+
DomHandler.focus(firstFocusableEl);
|
|
36214
|
+
firstHiddenFocusableElement.current.tabIndex = undefined;
|
|
36215
|
+
} else {
|
|
36216
|
+
DomHandler.focus(firstHiddenFocusableElement.current);
|
|
36217
|
+
}
|
|
36218
|
+
astHiddenFocusableElement.current.tabIndex = -1;
|
|
36219
|
+
};
|
|
35643
36220
|
var getOptionGroupRenderKey = function getOptionGroupRenderKey(optionGroup) {
|
|
35644
36221
|
return ObjectUtils.resolveFieldData(optionGroup, props.optionGroupLabel);
|
|
35645
36222
|
};
|
|
@@ -35728,8 +36305,9 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35728
36305
|
var optionLabel = getOptionLabel(option);
|
|
35729
36306
|
var optionKey = j + '_' + getOptionRenderKey(option);
|
|
35730
36307
|
var disabled = isOptionDisabled(option);
|
|
35731
|
-
|
|
36308
|
+
disabled ? null : props.tabIndex || 0;
|
|
35732
36309
|
return /*#__PURE__*/React.createElement(ListBoxItem, {
|
|
36310
|
+
id: id.current + '_' + j,
|
|
35733
36311
|
hostName: "ListBox",
|
|
35734
36312
|
key: optionKey,
|
|
35735
36313
|
label: optionLabel,
|
|
@@ -35738,8 +36316,9 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35738
36316
|
template: props.itemTemplate,
|
|
35739
36317
|
selected: isSelected(option),
|
|
35740
36318
|
onClick: onOptionSelect,
|
|
36319
|
+
index: j,
|
|
36320
|
+
focusedOptionIndex: focusedOptionIndex,
|
|
35741
36321
|
onTouchEnd: onOptionTouchEnd,
|
|
35742
|
-
tabIndex: tabIndex,
|
|
35743
36322
|
disabled: disabled,
|
|
35744
36323
|
ptCallbacks: ptCallbacks,
|
|
35745
36324
|
metaData: metaData
|
|
@@ -35769,18 +36348,20 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35769
36348
|
var optionLabel = getOptionLabel(option);
|
|
35770
36349
|
var optionKey = index + '_' + getOptionRenderKey(option);
|
|
35771
36350
|
var disabled = isOptionDisabled(option);
|
|
35772
|
-
|
|
36351
|
+
disabled ? null : props.tabIndex || 0;
|
|
35773
36352
|
return /*#__PURE__*/React.createElement(ListBoxItem, {
|
|
36353
|
+
id: id.current + '_' + index,
|
|
35774
36354
|
hostName: "ListBox",
|
|
35775
36355
|
key: optionKey,
|
|
35776
36356
|
label: optionLabel,
|
|
36357
|
+
index: index,
|
|
36358
|
+
focusedOptionIndex: focusedOptionIndex,
|
|
35777
36359
|
option: option,
|
|
35778
36360
|
style: style,
|
|
35779
36361
|
template: props.itemTemplate,
|
|
35780
36362
|
selected: isSelected(option),
|
|
35781
36363
|
onClick: onOptionSelect,
|
|
35782
36364
|
onTouchEnd: onOptionTouchEnd,
|
|
35783
|
-
tabIndex: tabIndex,
|
|
35784
36365
|
disabled: disabled,
|
|
35785
36366
|
ptCallbacks: ptCallbacks,
|
|
35786
36367
|
metaData: metaData
|
|
@@ -35824,6 +36405,7 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35824
36405
|
options: options
|
|
35825
36406
|
}),
|
|
35826
36407
|
role: 'listbox',
|
|
36408
|
+
tabIndex: '-1',
|
|
35827
36409
|
'aria-multiselectable': props.multiple
|
|
35828
36410
|
}, ariaProps), ptCallbacks.ptm('list'));
|
|
35829
36411
|
return /*#__PURE__*/React.createElement("ul", listProps, options.children);
|
|
@@ -35837,9 +36419,12 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35837
36419
|
} else {
|
|
35838
36420
|
var items = createItems();
|
|
35839
36421
|
var listProps = mergeProps(_objectSpread$O({
|
|
36422
|
+
ref: listRef,
|
|
35840
36423
|
className: ptCallbacks.cx('list'),
|
|
35841
36424
|
role: 'listbox',
|
|
35842
|
-
'aria-multiselectable': props.multiple
|
|
36425
|
+
'aria-multiselectable': props.multiple,
|
|
36426
|
+
tabIndex: '-1',
|
|
36427
|
+
onKeyDown: onKeyDown
|
|
35843
36428
|
}, ariaProps), ptCallbacks.ptm('list'));
|
|
35844
36429
|
return /*#__PURE__*/React.createElement("ul", listProps, items);
|
|
35845
36430
|
}
|
|
@@ -35860,7 +36445,27 @@ var ListBox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
35860
36445
|
className: ptCallbacks.cx('root'),
|
|
35861
36446
|
style: props.style
|
|
35862
36447
|
}, ListBoxBase.getOtherProps(props), ptCallbacks.ptm('root'));
|
|
35863
|
-
|
|
36448
|
+
var hiddenFirstElement = mergeProps({
|
|
36449
|
+
ref: firstHiddenFocusableElement,
|
|
36450
|
+
role: 'presentation',
|
|
36451
|
+
'aria-hidden': 'true',
|
|
36452
|
+
className: 'p-hidden-accessible p-hidden-focusable',
|
|
36453
|
+
tabIndex: !props.disabled ? props.tabIndex : -1,
|
|
36454
|
+
onFocus: onFirstHiddenFocus,
|
|
36455
|
+
'data-p-hidden-accessible': true,
|
|
36456
|
+
'data-p-hidden-focusable': true
|
|
36457
|
+
}, ptCallbacks.ptm('hiddenFirstFocusableEl'));
|
|
36458
|
+
var hiddenLastElement = mergeProps({
|
|
36459
|
+
ref: lastHiddenFocusableElement,
|
|
36460
|
+
role: 'presentation',
|
|
36461
|
+
'aria-hidden': 'true',
|
|
36462
|
+
className: 'p-hidden-accessible p-hidden-focusable',
|
|
36463
|
+
tabIndex: !props.disabled ? props.tabIndex : -1,
|
|
36464
|
+
onFocus: onLastHiddenFocus,
|
|
36465
|
+
'data-p-hidden-accessible': true,
|
|
36466
|
+
'data-p-hidden-focusable': true
|
|
36467
|
+
}, ptCallbacks.ptm('hiddenFirstFocusableEl'));
|
|
36468
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("span", hiddenFirstElement), header, /*#__PURE__*/React.createElement("div", wrapperProps, list), /*#__PURE__*/React.createElement("span", hiddenLastElement)), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
35864
36469
|
target: elementRef,
|
|
35865
36470
|
content: props.tooltip
|
|
35866
36471
|
}, props.tooltipOptions, {
|
|
@@ -37041,7 +37646,7 @@ var MegaMenu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
37041
37646
|
'aria-haspopup': props.model && props.model.length > 0 ? true : false,
|
|
37042
37647
|
'aria-expanded': mobileActiveState,
|
|
37043
37648
|
'aria-controls': idState,
|
|
37044
|
-
'aria-label': ariaLabel
|
|
37649
|
+
'aria-label': ariaLabel('navigation'),
|
|
37045
37650
|
tabIndex: 0,
|
|
37046
37651
|
onClick: function onClick(e) {
|
|
37047
37652
|
return toggle(e);
|
|
@@ -37737,7 +38342,8 @@ var Menu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
37737
38342
|
props: props,
|
|
37738
38343
|
state: {
|
|
37739
38344
|
id: idState,
|
|
37740
|
-
visible: visibleState
|
|
38345
|
+
visible: visibleState,
|
|
38346
|
+
focused: focused
|
|
37741
38347
|
}
|
|
37742
38348
|
}),
|
|
37743
38349
|
ptm = _MenuBase$setMetaData.ptm,
|
|
@@ -38036,7 +38642,7 @@ var Menu = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inPr
|
|
|
38036
38642
|
'aria-disabled': item.disabled,
|
|
38037
38643
|
'data-p-disabled': item.disabled
|
|
38038
38644
|
}, ptm('action'));
|
|
38039
|
-
var content = /*#__PURE__*/React.createElement("div", contentProps, /*#__PURE__*/React.createElement("a", actionProps, icon, label));
|
|
38645
|
+
var content = /*#__PURE__*/React.createElement("div", contentProps, /*#__PURE__*/React.createElement("a", actionProps, icon, label, /*#__PURE__*/React.createElement(Ripple, null)));
|
|
38040
38646
|
if (item.template) {
|
|
38041
38647
|
var defaultContentOptions = {
|
|
38042
38648
|
onClick: function onClick(event) {
|
|
@@ -39090,7 +39696,7 @@ var Menubar = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
|
|
|
39090
39696
|
tabIndex: '0',
|
|
39091
39697
|
'aria-haspopup': mobileActiveState && props.model && props.model.lentgh > 0 ? true : false,
|
|
39092
39698
|
'aria-expanded': mobileActiveState,
|
|
39093
|
-
'aria-label': ariaLabel
|
|
39699
|
+
'aria-label': ariaLabel('navigation'),
|
|
39094
39700
|
'aria-controls': idState,
|
|
39095
39701
|
role: 'button'
|
|
39096
39702
|
}, "tabIndex", 0), "className", cx('button')), "onKeyDown", function onKeyDown(e) {
|
|
@@ -39309,7 +39915,8 @@ var classes$v = {
|
|
|
39309
39915
|
var props = _ref5.itemProps;
|
|
39310
39916
|
return classNames('p-multiselect-item', {
|
|
39311
39917
|
'p-highlight': props.selected,
|
|
39312
|
-
'p-disabled': props.disabled
|
|
39918
|
+
'p-disabled': props.disabled,
|
|
39919
|
+
'p-focus': props.focusedOptionIndex === props.index
|
|
39313
39920
|
});
|
|
39314
39921
|
},
|
|
39315
39922
|
checkboxContainer: 'p-checkbox p-component',
|
|
@@ -39322,7 +39929,7 @@ var classes$v = {
|
|
|
39322
39929
|
},
|
|
39323
39930
|
transition: 'p-connected-overlay'
|
|
39324
39931
|
};
|
|
39325
|
-
var styles$r = "\n@layer primereact {\n .p-multiselect {\n display: inline-flex;\n user-select: none;\n cursor: pointer;\n }\n \n .p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n cursor: pointer;\n }\n \n .p-multiselect-label-container {\n overflow: hidden;\n flex: 1 1 auto;\n cursor: pointer;\n }\n \n .p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n \n .p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n .p-multiselect-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n }\n \n .p-multiselect-token-icon {\n cursor: pointer;\n }\n \n .p-multiselect .p-multiselect-panel {\n min-width: 100%;\n }\n \n .p-multiselect-inline.p-multiselect-panel {\n border: none;\n position: initial;\n background: none;\n box-shadow: none;\n }\n \n .p-multiselect-inline.p-multiselect-panel .p-multiselect-items {\n padding: 0;\n }\n \n .p-multiselect-flex.p-multiselect-panel .p-multiselect-items {\n display: flex;\n flex-wrap: wrap;\n }\n \n .p-multiselect-items-wrapper {\n overflow: auto;\n }\n \n .p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-multiselect-item {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-multiselect-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .p-multiselect-select-all-label {\n margin-left: 0.5rem;\n }\n \n .p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n }\n \n .p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-multiselect-filter-container .p-inputtext {\n width: 100%;\n }\n \n .p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n }\n \n .p-multiselect-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-fluid .p-multiselect {\n display: flex;\n }\n}\n";
|
|
39932
|
+
var styles$r = "\n@layer primereact {\n .p-multiselect {\n display: inline-flex;\n user-select: none;\n cursor: pointer;\n }\n \n .p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n cursor: pointer;\n }\n \n .p-multiselect-label-container {\n overflow: hidden;\n flex: 1 1 auto;\n cursor: pointer;\n }\n \n .p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n \n .p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n .p-multiselect-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n }\n \n .p-multiselect-token-icon {\n cursor: pointer;\n }\n \n .p-multiselect .p-multiselect-panel {\n min-width: 100%;\n }\n \n .p-multiselect-inline.p-multiselect-panel {\n border: none;\n position: initial;\n background: none;\n box-shadow: none;\n }\n \n .p-multiselect-inline.p-multiselect-panel .p-multiselect-items {\n padding: 0;\n }\n \n .p-multiselect-flex.p-multiselect-panel .p-multiselect-items {\n display: flex;\n flex-wrap: wrap;\n }\n \n .p-multiselect-items-wrapper {\n overflow: auto;\n }\n \n .p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-multiselect-item {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n outline: none;\n }\n \n .p-multiselect-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .p-multiselect-select-all-label {\n margin-left: 0.5rem;\n }\n \n .p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n }\n \n .p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-multiselect-filter-container .p-inputtext {\n width: 100%;\n }\n \n .p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n }\n \n .p-multiselect-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n right: 3rem;\n }\n \n .p-fluid .p-multiselect {\n display: flex;\n }\n}\n";
|
|
39326
39933
|
var inlineStyles$a = {
|
|
39327
39934
|
root: function root(_ref7) {
|
|
39328
39935
|
var props = _ref7.props;
|
|
@@ -39356,6 +39963,8 @@ var MultiSelectBase = ComponentBase.extend({
|
|
|
39356
39963
|
filterBy: null,
|
|
39357
39964
|
filterInputAutoFocus: true,
|
|
39358
39965
|
filterLocale: undefined,
|
|
39966
|
+
selectOnFocus: false,
|
|
39967
|
+
autoOptionFocus: false,
|
|
39359
39968
|
filterMatchMode: 'contains',
|
|
39360
39969
|
filterPlaceholder: null,
|
|
39361
39970
|
filterTemplate: null,
|
|
@@ -39579,7 +40188,9 @@ var MultiSelectItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
39579
40188
|
context: {
|
|
39580
40189
|
selected: props.selected,
|
|
39581
40190
|
disabled: props.disabled,
|
|
39582
|
-
focused: focusedState
|
|
40191
|
+
focused: focusedState,
|
|
40192
|
+
focusedIndex: props.focusedIndex,
|
|
40193
|
+
index: props.index
|
|
39583
40194
|
}
|
|
39584
40195
|
});
|
|
39585
40196
|
};
|
|
@@ -39591,22 +40202,11 @@ var MultiSelectItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
39591
40202
|
};
|
|
39592
40203
|
var onClick = function onClick(event) {
|
|
39593
40204
|
if (props.onClick) {
|
|
39594
|
-
props.onClick(
|
|
39595
|
-
originalEvent: event,
|
|
39596
|
-
option: props.option
|
|
39597
|
-
});
|
|
40205
|
+
props.onClick(event, props.option);
|
|
39598
40206
|
}
|
|
39599
40207
|
event.preventDefault();
|
|
39600
40208
|
event.stopPropagation();
|
|
39601
40209
|
};
|
|
39602
|
-
var onKeyDown = function onKeyDown(event) {
|
|
39603
|
-
if (props.onKeyDown) {
|
|
39604
|
-
props.onKeyDown({
|
|
39605
|
-
originalEvent: event,
|
|
39606
|
-
option: props.option
|
|
39607
|
-
});
|
|
39608
|
-
}
|
|
39609
|
-
};
|
|
39610
40210
|
var checkboxIconProps = mergeProps({
|
|
39611
40211
|
className: cx('checkboxIcon')
|
|
39612
40212
|
}, getPTOptions('checkboxIcon'));
|
|
@@ -39615,7 +40215,7 @@ var MultiSelectItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
39615
40215
|
selected: props.selected
|
|
39616
40216
|
}) : null;
|
|
39617
40217
|
var content = props.template ? ObjectUtils.getJSXElement(props.template, props.option) : props.label;
|
|
39618
|
-
var tabIndex = props.disabled ?
|
|
40218
|
+
var tabIndex = props.disabled ? -1 : props.tabIndex;
|
|
39619
40219
|
var checkboxContainerProps = mergeProps({
|
|
39620
40220
|
className: cx('checkboxContainer')
|
|
39621
40221
|
}, getPTOptions('checkboxContainer'));
|
|
@@ -39631,7 +40231,6 @@ var MultiSelectItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
39631
40231
|
})),
|
|
39632
40232
|
style: props.style,
|
|
39633
40233
|
onClick: onClick,
|
|
39634
|
-
onKeyDown: onKeyDown,
|
|
39635
40234
|
onFocus: onFocus,
|
|
39636
40235
|
onBlur: onBlur,
|
|
39637
40236
|
tabIndex: tabIndex,
|
|
@@ -39733,14 +40332,15 @@ var MultiSelectPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
39733
40332
|
var selected = props.isSelected(option);
|
|
39734
40333
|
return /*#__PURE__*/React.createElement(MultiSelectItem, {
|
|
39735
40334
|
hostName: props.hostName,
|
|
40335
|
+
index: j,
|
|
39736
40336
|
key: optionKey,
|
|
40337
|
+
focusedOptionIndex: props.focusedOptionIndex,
|
|
39737
40338
|
label: optionLabel,
|
|
39738
40339
|
option: option,
|
|
39739
40340
|
style: style,
|
|
39740
40341
|
template: props.itemTemplate,
|
|
39741
40342
|
selected: selected,
|
|
39742
40343
|
onClick: props.onOptionSelect,
|
|
39743
|
-
onKeyDown: props.onOptionKeyDown,
|
|
39744
40344
|
tabIndex: tabIndex,
|
|
39745
40345
|
disabled: disabled,
|
|
39746
40346
|
className: props.itemClassName,
|
|
@@ -39791,13 +40391,14 @@ var MultiSelectPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
39791
40391
|
return /*#__PURE__*/React.createElement(MultiSelectItem, {
|
|
39792
40392
|
hostName: props.hostName,
|
|
39793
40393
|
key: optionKey,
|
|
40394
|
+
focusedOptionIndex: props.focusedOptionIndex,
|
|
39794
40395
|
label: optionLabel,
|
|
39795
40396
|
option: option,
|
|
39796
40397
|
style: style,
|
|
40398
|
+
index: index,
|
|
39797
40399
|
template: props.itemTemplate,
|
|
39798
40400
|
selected: selected,
|
|
39799
40401
|
onClick: props.onOptionSelect,
|
|
39800
|
-
onKeyDown: props.onOptionKeyDown,
|
|
39801
40402
|
tabIndex: tabIndex,
|
|
39802
40403
|
disabled: disabled,
|
|
39803
40404
|
className: props.itemClassName,
|
|
@@ -39926,19 +40527,35 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
39926
40527
|
var mergeProps = useMergeProps();
|
|
39927
40528
|
var context = React.useContext(PrimeReactContext);
|
|
39928
40529
|
var props = MultiSelectBase.getProps(inProps, context);
|
|
39929
|
-
var _React$useState = React.useState(
|
|
40530
|
+
var _React$useState = React.useState(null),
|
|
39930
40531
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
39931
|
-
|
|
39932
|
-
|
|
40532
|
+
focusedOptionIndex = _React$useState2[0],
|
|
40533
|
+
setFocusedOptionIndex = _React$useState2[1];
|
|
39933
40534
|
var _React$useState3 = React.useState(false),
|
|
39934
40535
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
39935
|
-
|
|
39936
|
-
|
|
39937
|
-
var _React$useState5 = React.useState(
|
|
40536
|
+
clicked = _React$useState4[0],
|
|
40537
|
+
setClicked = _React$useState4[1];
|
|
40538
|
+
var _React$useState5 = React.useState(''),
|
|
39938
40539
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
39939
|
-
|
|
39940
|
-
|
|
40540
|
+
filterState = _React$useState6[0],
|
|
40541
|
+
setFilterState = _React$useState6[1];
|
|
40542
|
+
var _React$useState7 = React.useState(-1),
|
|
40543
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
40544
|
+
startRangeIndex = _React$useState8[0],
|
|
40545
|
+
setStartRangeIndex = _React$useState8[1];
|
|
40546
|
+
var _React$useState9 = React.useState(false),
|
|
40547
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
40548
|
+
focusedState = _React$useState10[0],
|
|
40549
|
+
setFocusedState = _React$useState10[1];
|
|
40550
|
+
var _React$useState11 = React.useState(props.inline),
|
|
40551
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
40552
|
+
overlayVisibleState = _React$useState12[0],
|
|
40553
|
+
setOverlayVisibleState = _React$useState12[1];
|
|
39941
40554
|
var elementRef = React.useRef(null);
|
|
40555
|
+
var searchValue = React.useRef(null);
|
|
40556
|
+
var searchTimeout = React.useRef(null);
|
|
40557
|
+
var firstHiddenFocusableElementOnOverlay = React.useRef(null);
|
|
40558
|
+
var lastHiddenFocusableElementOnOverlay = React.useRef(null);
|
|
39942
40559
|
var inputRef = React.useRef(props.inputRef);
|
|
39943
40560
|
var labelRef = React.useRef(null);
|
|
39944
40561
|
var overlayRef = React.useRef(null);
|
|
@@ -39980,6 +40597,14 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
39980
40597
|
_useOverlayListener2 = _slicedToArray(_useOverlayListener, 2),
|
|
39981
40598
|
bindOverlayListener = _useOverlayListener2[0],
|
|
39982
40599
|
unbindOverlayListener = _useOverlayListener2[1];
|
|
40600
|
+
var onFirstHiddenFocus = function onFirstHiddenFocus(event) {
|
|
40601
|
+
var focusableEl = event.relatedTarget === inputRef.current ? DomHandler.getFirstFocusableElement(overlayRef.current, ':not([data-p-hidden-focusable="true"])') : inputRef.current;
|
|
40602
|
+
DomHandler.focus(focusableEl);
|
|
40603
|
+
};
|
|
40604
|
+
var onLastHiddenFocus = function onLastHiddenFocus(event) {
|
|
40605
|
+
var focusableEl = event.relatedTarget === inputRef.current ? DomHandler.getLastFocusableElement(overlayRef.current, ':not([data-p-hidden-focusable="true"])') : inputRef.current;
|
|
40606
|
+
DomHandler.focus(focusableEl);
|
|
40607
|
+
};
|
|
39983
40608
|
var onPanelClick = function onPanelClick(event) {
|
|
39984
40609
|
OverlayService.emit('overlay-click', {
|
|
39985
40610
|
originalEvent: event,
|
|
@@ -39989,63 +40614,60 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
39989
40614
|
var allowOptionSelect = function allowOptionSelect() {
|
|
39990
40615
|
return !props.selectionLimit || !props.value || props.value && props.value.length < props.selectionLimit;
|
|
39991
40616
|
};
|
|
39992
|
-
var
|
|
39993
|
-
var
|
|
39994
|
-
|
|
39995
|
-
|
|
39996
|
-
|
|
39997
|
-
}
|
|
39998
|
-
var optionValue = getOptionValue(option);
|
|
39999
|
-
var isUsed = isOptionValueUsed(option);
|
|
40000
|
-
var selected = isSelected(option);
|
|
40001
|
-
var allowSelect = allowOptionSelect();
|
|
40002
|
-
if (selected) {
|
|
40003
|
-
updateModel(originalEvent, props.value.filter(function (val) {
|
|
40004
|
-
return !ObjectUtils.equals(isUsed ? val : getOptionValue(val), optionValue, equalityKey);
|
|
40005
|
-
}), option);
|
|
40006
|
-
} else if (allowSelect) {
|
|
40007
|
-
updateModel(originalEvent, [].concat(_toConsumableArray(props.value || []), [optionValue]), option);
|
|
40008
|
-
}
|
|
40617
|
+
var findNextSelectedOptionIndex = function findNextSelectedOptionIndex(index) {
|
|
40618
|
+
var matchedOptionIndex = hasSelectedOption && index < visibleOptions.length - 1 ? visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
40619
|
+
return isValidSelectedOption(option);
|
|
40620
|
+
}) : -1;
|
|
40621
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : -1;
|
|
40009
40622
|
};
|
|
40010
|
-
var
|
|
40011
|
-
var
|
|
40012
|
-
|
|
40013
|
-
|
|
40014
|
-
|
|
40015
|
-
|
|
40016
|
-
|
|
40017
|
-
|
|
40018
|
-
|
|
40019
|
-
|
|
40020
|
-
|
|
40021
|
-
|
|
40022
|
-
|
|
40023
|
-
|
|
40024
|
-
|
|
40025
|
-
|
|
40026
|
-
|
|
40027
|
-
|
|
40028
|
-
//enter and space
|
|
40029
|
-
case 13:
|
|
40030
|
-
case 32:
|
|
40031
|
-
onOptionSelect(event);
|
|
40032
|
-
originalEvent.preventDefault();
|
|
40033
|
-
break;
|
|
40034
|
-
|
|
40035
|
-
//escape
|
|
40036
|
-
case 27:
|
|
40037
|
-
hide();
|
|
40038
|
-
DomHandler.focus(inputRef.current);
|
|
40039
|
-
break;
|
|
40623
|
+
var findPrevSelectedOptionIndex = function findPrevSelectedOptionIndex(index) {
|
|
40624
|
+
var matchedOptionIndex = hasSelectedOption && index > 0 ? ObjectUtils.findLastIndex(visibleOptions.slice(0, index), function (option) {
|
|
40625
|
+
return isValidSelectedOption(option);
|
|
40626
|
+
}) : -1;
|
|
40627
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex : -1;
|
|
40628
|
+
};
|
|
40629
|
+
var findNearestSelectedOptionIndex = function findNearestSelectedOptionIndex(index) {
|
|
40630
|
+
var firstCheckUp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40631
|
+
var matchedOptionIndex = -1;
|
|
40632
|
+
if (hasSelectedOption) {
|
|
40633
|
+
if (firstCheckUp) {
|
|
40634
|
+
matchedOptionIndex = findPrevSelectedOptionIndex(index);
|
|
40635
|
+
matchedOptionIndex = matchedOptionIndex === -1 ? findNextSelectedOptionIndex(index) : matchedOptionIndex;
|
|
40636
|
+
} else {
|
|
40637
|
+
matchedOptionIndex = findNextSelectedOptionIndex(index);
|
|
40638
|
+
matchedOptionIndex = matchedOptionIndex === -1 ? findPrevSelectedOptionIndex(index) : matchedOptionIndex;
|
|
40639
|
+
}
|
|
40040
40640
|
}
|
|
40641
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
40041
40642
|
};
|
|
40042
|
-
var
|
|
40043
|
-
var
|
|
40044
|
-
|
|
40643
|
+
var onOptionSelectRange = function onOptionSelectRange(event) {
|
|
40644
|
+
var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
|
40645
|
+
var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
40646
|
+
start === -1 && (start = findNearestSelectedOptionIndex(end, true));
|
|
40647
|
+
end === -1 && (end = findNearestSelectedOptionIndex(start));
|
|
40648
|
+
if (start !== -1 && end !== -1) {
|
|
40649
|
+
var rangeStart = Math.min(start, end);
|
|
40650
|
+
var rangeEnd = Math.max(start, end);
|
|
40651
|
+
var value = visibleOptions.slice(rangeStart, rangeEnd + 1).filter(function (option) {
|
|
40652
|
+
return isValidOption(option);
|
|
40653
|
+
}).map(function (option) {
|
|
40654
|
+
return getOptionValue(option);
|
|
40655
|
+
});
|
|
40656
|
+
updateModel(event, value);
|
|
40657
|
+
}
|
|
40045
40658
|
};
|
|
40046
|
-
var
|
|
40047
|
-
var
|
|
40048
|
-
|
|
40659
|
+
var onOptionSelect = function onOptionSelect(event, option) {
|
|
40660
|
+
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
40661
|
+
if (props.disabled || isOptionDisabled(option)) {
|
|
40662
|
+
return;
|
|
40663
|
+
}
|
|
40664
|
+
var selected = isSelected(option);
|
|
40665
|
+
var value = null;
|
|
40666
|
+
if (selected) value = props.value.filter(function (val) {
|
|
40667
|
+
return !ObjectUtils.equals(val, getOptionValue(option), equalityKey);
|
|
40668
|
+
});else value = [].concat(_toConsumableArray(props.value || []), [getOptionValue(option)]);
|
|
40669
|
+
updateModel(event, value);
|
|
40670
|
+
index !== -1 && setFocusedOptionIndex(index);
|
|
40049
40671
|
};
|
|
40050
40672
|
var onClick = function onClick(event) {
|
|
40051
40673
|
if (!props.inline && !props.disabled && !props.loading && !isPanelClicked(event) && DomHandler.getAttribute(event.target, 'data-pc-section') !== 'removetokenicon' && !isClearClicked(event)) {
|
|
@@ -40053,42 +40675,170 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40053
40675
|
DomHandler.focus(inputRef.current);
|
|
40054
40676
|
event.preventDefault();
|
|
40055
40677
|
}
|
|
40678
|
+
setClicked(true);
|
|
40679
|
+
};
|
|
40680
|
+
var onArrowDownKey = function onArrowDownKey(event) {
|
|
40681
|
+
if (!overlayVisibleState) {
|
|
40682
|
+
show();
|
|
40683
|
+
props.editable && changeFocusedOptionIndex(event, findSelectedOptionIndex());
|
|
40684
|
+
} else {
|
|
40685
|
+
var optionIndex = focusedOptionIndex !== -1 ? findNextOptionIndex(focusedOptionIndex) : clicked ? findFirstOptionIndex() : findFirstFocusedOptionIndex();
|
|
40686
|
+
if (event.shiftKey) {
|
|
40687
|
+
onOptionSelectRange(event, startRangeIndex, optionIndex);
|
|
40688
|
+
}
|
|
40689
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
40690
|
+
}
|
|
40691
|
+
event.preventDefault();
|
|
40692
|
+
};
|
|
40693
|
+
var onArrowUpKey = function onArrowUpKey(event) {
|
|
40694
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40695
|
+
if (event.altKey && !pressedInInputText) {
|
|
40696
|
+
if (focusedOptionIndex !== -1) {
|
|
40697
|
+
onOptionSelect(event, visibleOptions[focusedOptionIndex]);
|
|
40698
|
+
}
|
|
40699
|
+
overlayVisibleState && hide();
|
|
40700
|
+
event.preventDefault();
|
|
40701
|
+
} else {
|
|
40702
|
+
var optionIndex = focusedOptionIndex !== -1 ? findPrevOptionIndex(focusedOptionIndex) : clicked ? findLastOptionIndex() : findLastFocusedOptionIndex();
|
|
40703
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
40704
|
+
!overlayVisibleState && show();
|
|
40705
|
+
event.preventDefault();
|
|
40706
|
+
}
|
|
40707
|
+
};
|
|
40708
|
+
var onEnterKey = function onEnterKey(event) {
|
|
40709
|
+
if (!overlayVisibleState) {
|
|
40710
|
+
setFocusedOptionIndex(-1);
|
|
40711
|
+
onArrowDownKey(event);
|
|
40712
|
+
} else {
|
|
40713
|
+
if (focusedOptionIndex !== -1) {
|
|
40714
|
+
if (event.shiftKey) onOptionSelectRange(event, focusedOptionIndex);else onOptionSelect(event, visibleOptions[focusedOptionIndex]);
|
|
40715
|
+
}
|
|
40716
|
+
hide();
|
|
40717
|
+
}
|
|
40718
|
+
event.preventDefault();
|
|
40719
|
+
};
|
|
40720
|
+
var onHomeKey = function onHomeKey(event) {
|
|
40721
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40722
|
+
var currentTarget = event.currentTarget;
|
|
40723
|
+
if (pressedInInputText) {
|
|
40724
|
+
var len = currentTarget.value.length;
|
|
40725
|
+
currentTarget.setSelectionRange(0, event.shiftKey ? len : 0);
|
|
40726
|
+
setFocusedOptionIndex(-1);
|
|
40727
|
+
} else {
|
|
40728
|
+
var metaKey = event.metaKey || event.ctrlKey;
|
|
40729
|
+
var optionIndex = findFirstOptionIndex();
|
|
40730
|
+
if (event.shiftKey && metaKey) {
|
|
40731
|
+
onOptionSelectRange(event, optionIndex, startRangeIndex);
|
|
40732
|
+
}
|
|
40733
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
40734
|
+
!overlayVisibleState && show();
|
|
40735
|
+
}
|
|
40736
|
+
event.preventDefault();
|
|
40737
|
+
};
|
|
40738
|
+
var onEndKey = function onEndKey(event) {
|
|
40739
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40740
|
+
var currentTarget = event.currentTarget;
|
|
40741
|
+
if (pressedInInputText) {
|
|
40742
|
+
var len = currentTarget.value.length;
|
|
40743
|
+
currentTarget.setSelectionRange(event.shiftKey ? 0 : len, len);
|
|
40744
|
+
_readOnlyError("focusedOptionIndex");
|
|
40745
|
+
} else {
|
|
40746
|
+
var metaKey = event.metaKey || event.ctrlKey;
|
|
40747
|
+
var optionIndex = findLastOptionIndex();
|
|
40748
|
+
if (event.shiftKey && metaKey) {
|
|
40749
|
+
onOptionSelectRange(event, startRangeIndex, optionIndex);
|
|
40750
|
+
}
|
|
40751
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
40752
|
+
!overlayVisibleState && show();
|
|
40753
|
+
}
|
|
40754
|
+
event.preventDefault();
|
|
40755
|
+
};
|
|
40756
|
+
var onPageUpKey = function onPageUpKey(event) {
|
|
40757
|
+
event.preventDefault();
|
|
40758
|
+
};
|
|
40759
|
+
var onPageDownKey = function onPageDownKey(event) {
|
|
40760
|
+
event.preventDefault();
|
|
40761
|
+
};
|
|
40762
|
+
var onTabKey = function onTabKey(event) {
|
|
40763
|
+
var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40764
|
+
if (!pressedInInputText) {
|
|
40765
|
+
if (overlayVisibleState && hasFocusableElements()) {
|
|
40766
|
+
DomHandler.focus(event.shiftKey ? lastHiddenFocusableElementOnOverlay.current : firstHiddenFocusableElementOnOverlay.current);
|
|
40767
|
+
event.preventDefault();
|
|
40768
|
+
} else {
|
|
40769
|
+
if (focusedOptionIndex !== -1) {
|
|
40770
|
+
onOptionSelect(event, visibleOptions[focusedOptionIndex]);
|
|
40771
|
+
}
|
|
40772
|
+
overlayVisibleState && hide(filter);
|
|
40773
|
+
}
|
|
40774
|
+
}
|
|
40775
|
+
};
|
|
40776
|
+
var onShiftKey = function onShiftKey() {
|
|
40777
|
+
setStartRangeIndex(focusedOptionIndex);
|
|
40056
40778
|
};
|
|
40057
40779
|
var onKeyDown = function onKeyDown(event) {
|
|
40058
|
-
|
|
40059
|
-
|
|
40060
|
-
case
|
|
40780
|
+
var metaKey = event.metaKey || event.ctrlKey;
|
|
40781
|
+
switch (event.code) {
|
|
40782
|
+
case 'ArrowUp':
|
|
40061
40783
|
if (props.inline) break;
|
|
40062
|
-
|
|
40063
|
-
show();
|
|
40064
|
-
event.preventDefault();
|
|
40065
|
-
}
|
|
40784
|
+
onArrowUpKey(event);
|
|
40066
40785
|
break;
|
|
40067
|
-
|
|
40068
|
-
//space
|
|
40069
|
-
case 32:
|
|
40786
|
+
case 'ArrowDown':
|
|
40070
40787
|
if (props.inline) break;
|
|
40071
|
-
|
|
40788
|
+
onArrowDownKey(event);
|
|
40789
|
+
break;
|
|
40790
|
+
case 'Space':
|
|
40791
|
+
case 'NumpadEnter':
|
|
40792
|
+
case 'Enter':
|
|
40793
|
+
if (props.inline) break;
|
|
40794
|
+
onEnterKey(event);
|
|
40795
|
+
break;
|
|
40796
|
+
case 'Home':
|
|
40797
|
+
if (props.inline) break;
|
|
40798
|
+
onHomeKey(event);
|
|
40072
40799
|
event.preventDefault();
|
|
40073
40800
|
break;
|
|
40074
|
-
|
|
40075
|
-
|
|
40076
|
-
|
|
40801
|
+
case 'End':
|
|
40802
|
+
if (props.inline) break;
|
|
40803
|
+
onEndKey(event);
|
|
40804
|
+
event.preventDefault();
|
|
40805
|
+
break;
|
|
40806
|
+
case 'PageDown':
|
|
40807
|
+
onPageDownKey(event);
|
|
40808
|
+
break;
|
|
40809
|
+
case 'PageUp':
|
|
40810
|
+
onPageUpKey(event);
|
|
40811
|
+
break;
|
|
40812
|
+
case 'Escape':
|
|
40077
40813
|
if (props.inline) break;
|
|
40078
40814
|
hide();
|
|
40079
40815
|
break;
|
|
40080
|
-
|
|
40081
|
-
|
|
40082
|
-
|
|
40083
|
-
|
|
40084
|
-
|
|
40085
|
-
|
|
40086
|
-
|
|
40087
|
-
|
|
40088
|
-
|
|
40816
|
+
case 'Tab':
|
|
40817
|
+
onTabKey(event);
|
|
40818
|
+
break;
|
|
40819
|
+
case 'ShiftLeft':
|
|
40820
|
+
case 'ShiftRight':
|
|
40821
|
+
onShiftKey();
|
|
40822
|
+
break;
|
|
40823
|
+
default:
|
|
40824
|
+
if (event.code === 'KeyA' && metaKey) {
|
|
40825
|
+
var value = visibleOptions.filter(function (option) {
|
|
40826
|
+
return isValidOption(option);
|
|
40827
|
+
}).map(function (option) {
|
|
40828
|
+
return getOptionValue(option);
|
|
40829
|
+
});
|
|
40830
|
+
updateModel(event, value);
|
|
40831
|
+
event.preventDefault();
|
|
40832
|
+
break;
|
|
40833
|
+
}
|
|
40834
|
+
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
|
40835
|
+
!overlayVisibleState && show();
|
|
40836
|
+
searchOptions(event);
|
|
40837
|
+
event.preventDefault();
|
|
40089
40838
|
}
|
|
40090
40839
|
break;
|
|
40091
40840
|
}
|
|
40841
|
+
setClicked(false);
|
|
40092
40842
|
};
|
|
40093
40843
|
var onSelectAll = function onSelectAll(event) {
|
|
40094
40844
|
if (props.onSelectAll) {
|
|
@@ -40174,9 +40924,13 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40174
40924
|
};
|
|
40175
40925
|
var show = function show() {
|
|
40176
40926
|
setOverlayVisibleState(true);
|
|
40927
|
+
setFocusedOptionIndex(focusedOptionIndex !== -1 ? focusedOptionIndex : props.autoOptionFocus ? findFirstFocusedOptionIndex() : findSelectedOptionIndex());
|
|
40928
|
+
DomHandler.focus(inputRef.current);
|
|
40177
40929
|
};
|
|
40178
40930
|
var hide = function hide() {
|
|
40931
|
+
setFocusedOptionIndex(-1);
|
|
40179
40932
|
setOverlayVisibleState(false);
|
|
40933
|
+
setClicked(false);
|
|
40180
40934
|
};
|
|
40181
40935
|
var onOverlayEnter = function onOverlayEnter(callback) {
|
|
40182
40936
|
ZIndexUtils.set('overlay', overlayRef.current, context && context.autoZIndex || PrimeReact.autoZIndex, context && context.zIndex['overlay'] || PrimeReact.zIndex['overlay']);
|
|
@@ -40370,6 +41124,100 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40370
41124
|
var isOptionValueUsed = function isOptionValueUsed(option) {
|
|
40371
41125
|
return !props.useOptionAsValue && props.optionValue || option && option['value'] !== undefined;
|
|
40372
41126
|
};
|
|
41127
|
+
var isOptionGroup = function isOptionGroup(option) {
|
|
41128
|
+
return props.optionGroupLabel && option.optionGroup && option.group;
|
|
41129
|
+
};
|
|
41130
|
+
var hasSelectedOption = function hasSelectedOption() {
|
|
41131
|
+
return ObjectUtils.isNotEmpty(props.value);
|
|
41132
|
+
};
|
|
41133
|
+
var hasFocusableElements = function hasFocusableElements() {
|
|
41134
|
+
return DomHandler.getFocusableElements(overlayRef.current, ':not([data-p-hidden-focusable="true"])').length > 0;
|
|
41135
|
+
};
|
|
41136
|
+
var isOptionMatched = function isOptionMatched(option) {
|
|
41137
|
+
var _getOptionLabel;
|
|
41138
|
+
return isValidOption(option) && ((_getOptionLabel = getOptionLabel(option)) === null || _getOptionLabel === void 0 ? void 0 : _getOptionLabel.toLocaleLowerCase(props.filterLocale).startsWith(searchValue.current.toLocaleLowerCase(props.filterLocale)));
|
|
41139
|
+
};
|
|
41140
|
+
var isValidOption = function isValidOption(option) {
|
|
41141
|
+
return ObjectUtils.isNotEmpty(option) && !(isOptionDisabled(option) || isOptionGroup(option));
|
|
41142
|
+
};
|
|
41143
|
+
var isValidSelectedOption = function isValidSelectedOption(option) {
|
|
41144
|
+
return isValidOption(option) && isSelected(option);
|
|
41145
|
+
};
|
|
41146
|
+
var findSelectedOptionIndex = function findSelectedOptionIndex() {
|
|
41147
|
+
return hasSelectedOption ? visibleOptions === null || visibleOptions === void 0 ? void 0 : visibleOptions.findIndex(function (option) {
|
|
41148
|
+
return isValidSelectedOption(option);
|
|
41149
|
+
}) : -1;
|
|
41150
|
+
};
|
|
41151
|
+
var findFirstFocusedOptionIndex = function findFirstFocusedOptionIndex() {
|
|
41152
|
+
var selectedIndex = findSelectedOptionIndex();
|
|
41153
|
+
return selectedIndex < 0 ? findFirstOptionIndex() : selectedIndex;
|
|
41154
|
+
};
|
|
41155
|
+
var findLastFocusedOptionIndex = function findLastFocusedOptionIndex() {
|
|
41156
|
+
var selectedIndex = findSelectedOptionIndex();
|
|
41157
|
+
return selectedIndex < 0 ? findLastOptionIndex() : selectedIndex;
|
|
41158
|
+
};
|
|
41159
|
+
var findFirstOptionIndex = function findFirstOptionIndex() {
|
|
41160
|
+
return visibleOptions.findIndex(function (option) {
|
|
41161
|
+
return isValidOption(option);
|
|
41162
|
+
});
|
|
41163
|
+
};
|
|
41164
|
+
var findLastOptionIndex = function findLastOptionIndex() {
|
|
41165
|
+
return ObjectUtils.findLastIndex(visibleOptions, function (option) {
|
|
41166
|
+
return isValidOption(option);
|
|
41167
|
+
});
|
|
41168
|
+
};
|
|
41169
|
+
var findNextOptionIndex = function findNextOptionIndex(index) {
|
|
41170
|
+
var matchedOptionIndex = index < visibleOptions.length - 1 ? visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
41171
|
+
return isValidOption(option);
|
|
41172
|
+
}) : -1;
|
|
41173
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
|
|
41174
|
+
};
|
|
41175
|
+
var findPrevOptionIndex = function findPrevOptionIndex(index) {
|
|
41176
|
+
var matchedOptionIndex = index > 0 ? ObjectUtils.findLastIndex(visibleOptions.slice(0, index), function (option) {
|
|
41177
|
+
return isValidOption(option);
|
|
41178
|
+
}) : -1;
|
|
41179
|
+
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
41180
|
+
};
|
|
41181
|
+
var searchOptions = function searchOptions(event) {
|
|
41182
|
+
searchValue.current = (searchValue.current || '') + event.key;
|
|
41183
|
+
var optionIndex = -1;
|
|
41184
|
+
if (ObjectUtils.isNotEmpty(searchValue.current)) {
|
|
41185
|
+
if (focusedOptionIndex !== -1) {
|
|
41186
|
+
optionIndex = visibleOptions.slice(focusedOptionIndex).findIndex(function (option) {
|
|
41187
|
+
return isOptionMatched(option);
|
|
41188
|
+
});
|
|
41189
|
+
optionIndex = optionIndex === -1 ? visibleOptions.slice(0, focusedOptionIndex).findIndex(function (option) {
|
|
41190
|
+
return isOptionMatched(option);
|
|
41191
|
+
}) : optionIndex + focusedOptionIndex;
|
|
41192
|
+
} else {
|
|
41193
|
+
optionIndex = visibleOptions.findIndex(function (option) {
|
|
41194
|
+
return isOptionMatched(option);
|
|
41195
|
+
});
|
|
41196
|
+
}
|
|
41197
|
+
if (optionIndex === -1 && focusedOptionIndex === -1) {
|
|
41198
|
+
optionIndex = findFirstFocusedOptionIndex();
|
|
41199
|
+
}
|
|
41200
|
+
if (optionIndex !== -1) {
|
|
41201
|
+
changeFocusedOptionIndex(event, optionIndex);
|
|
41202
|
+
}
|
|
41203
|
+
}
|
|
41204
|
+
if (searchTimeout.current) {
|
|
41205
|
+
clearTimeout(searchTimeout.current);
|
|
41206
|
+
}
|
|
41207
|
+
searchTimeout.current = setTimeout(function () {
|
|
41208
|
+
searchValue.current = '';
|
|
41209
|
+
searchTimeout.current = null;
|
|
41210
|
+
}, 500);
|
|
41211
|
+
};
|
|
41212
|
+
var changeFocusedOptionIndex = function changeFocusedOptionIndex(event, index) {
|
|
41213
|
+
if (focusedOptionIndex !== index) {
|
|
41214
|
+
setFocusedOptionIndex(index);
|
|
41215
|
+
scrollInView();
|
|
41216
|
+
if (props.selectOnFocus) {
|
|
41217
|
+
onOptionSelect(event, visibleOptions[index], false);
|
|
41218
|
+
}
|
|
41219
|
+
}
|
|
41220
|
+
};
|
|
40373
41221
|
var removeChip = function removeChip(event, item) {
|
|
40374
41222
|
var value = props.value.filter(function (val) {
|
|
40375
41223
|
return !ObjectUtils.equals(val, item, equalityKey);
|
|
@@ -40510,6 +41358,7 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40510
41358
|
setTimeout(function () {
|
|
40511
41359
|
props.overlayVisible ? show() : hide();
|
|
40512
41360
|
}, 100);
|
|
41361
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40513
41362
|
}, [props.overlayVisible]);
|
|
40514
41363
|
useUpdateEffect(function () {
|
|
40515
41364
|
if (overlayVisibleState && filterState && hasFilter) {
|
|
@@ -40594,11 +41443,31 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40594
41443
|
role: 'listbox',
|
|
40595
41444
|
'aria-expanded': overlayVisibleState,
|
|
40596
41445
|
disabled: props.disabled,
|
|
40597
|
-
tabIndex: props.tabIndex
|
|
41446
|
+
tabIndex: !props.disabled ? props.tabIndex : -1
|
|
40598
41447
|
}, ariaProps), ptm('input'));
|
|
41448
|
+
var firstHiddenElementProps = mergeProps({
|
|
41449
|
+
ref: firstHiddenFocusableElementOnOverlay,
|
|
41450
|
+
role: 'presentation',
|
|
41451
|
+
'aria-hidden': true,
|
|
41452
|
+
className: 'p-hidden-accessible p-hidden-focusable',
|
|
41453
|
+
tabIndex: '0',
|
|
41454
|
+
onFocus: onFirstHiddenFocus,
|
|
41455
|
+
'data-p-hidden-accessible': true,
|
|
41456
|
+
'data-p-hidden-focusable': true
|
|
41457
|
+
}, ptm('hiddenFirstFocusableEl'));
|
|
41458
|
+
var lastHiddenElementProps = mergeProps({
|
|
41459
|
+
ref: lastHiddenFocusableElementOnOverlay,
|
|
41460
|
+
role: 'presentation',
|
|
41461
|
+
'aria-hidden': true,
|
|
41462
|
+
className: 'p-hidden-accessible p-hidden-focusable',
|
|
41463
|
+
tabIndex: '0',
|
|
41464
|
+
onFocus: onLastHiddenFocus,
|
|
41465
|
+
'data-p-hidden-accessible': true,
|
|
41466
|
+
'data-p-hidden-focusable': true
|
|
41467
|
+
}, ptm('hiddenLastFocusableEl'));
|
|
40599
41468
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement("div", hiddenInputWrapperProps, /*#__PURE__*/React.createElement("input", _extends({}, inputProps, {
|
|
40600
41469
|
readOnly: true
|
|
40601
|
-
}))), !props.inline && /*#__PURE__*/React.createElement(React.Fragment, null, label, clearIcon, triggerIcon), /*#__PURE__*/React.createElement(MultiSelectPanel, _extends({
|
|
41470
|
+
}))), !props.inline && /*#__PURE__*/React.createElement(React.Fragment, null, label, clearIcon, triggerIcon), /*#__PURE__*/React.createElement("span", firstHiddenElementProps), /*#__PURE__*/React.createElement(MultiSelectPanel, _extends({
|
|
40602
41471
|
hostName: "MultiSelect",
|
|
40603
41472
|
ref: overlayRef,
|
|
40604
41473
|
visibleOptions: visibleOptions
|
|
@@ -40606,6 +41475,8 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40606
41475
|
onClick: onPanelClick,
|
|
40607
41476
|
onOverlayHide: hide,
|
|
40608
41477
|
filterValue: filterState,
|
|
41478
|
+
focusedOptionIndex: focusedOptionIndex,
|
|
41479
|
+
setFocusedOptionIndex: setFocusedOptionIndex,
|
|
40609
41480
|
hasFilter: hasFilter,
|
|
40610
41481
|
onFilterInputChange: onFilterInputChange,
|
|
40611
41482
|
resetFilter: resetFilter,
|
|
@@ -40622,7 +41493,6 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40622
41493
|
isAllSelected: isAllSelected,
|
|
40623
41494
|
onOptionSelect: onOptionSelect,
|
|
40624
41495
|
allowOptionSelect: allowOptionSelect,
|
|
40625
|
-
onOptionKeyDown: onOptionKeyDown,
|
|
40626
41496
|
"in": overlayVisibleState,
|
|
40627
41497
|
onEnter: onOverlayEnter,
|
|
40628
41498
|
onEntered: onOverlayEntered,
|
|
@@ -40633,7 +41503,7 @@ var MultiSelect = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
40633
41503
|
sx: sx,
|
|
40634
41504
|
isUnstyled: isUnstyled,
|
|
40635
41505
|
metaData: metaData
|
|
40636
|
-
}))), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
41506
|
+
})), /*#__PURE__*/React.createElement("span", lastHiddenElementProps)), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
40637
41507
|
target: elementRef,
|
|
40638
41508
|
content: props.tooltip
|
|
40639
41509
|
}, props.tooltipOptions, {
|
|
@@ -40838,7 +41708,7 @@ var MultiStateCheckbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(
|
|
|
40838
41708
|
var otherProps = MultiStateCheckboxBase.getOtherProps(props);
|
|
40839
41709
|
var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
|
|
40840
41710
|
var icon = createIcon();
|
|
40841
|
-
var ariaValueLabel = !!selectedOption ? getOptionAriaLabel(selectedOption) : ariaLabel
|
|
41711
|
+
var ariaValueLabel = !!selectedOption ? getOptionAriaLabel(selectedOption) : ariaLabel('nullLabel');
|
|
40842
41712
|
var ariaChecked = !!selectedOption ? 'true' : 'false';
|
|
40843
41713
|
var rootProps = mergeProps({
|
|
40844
41714
|
ref: elementRef,
|
|
@@ -41047,7 +41917,7 @@ var OrderListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
41047
41917
|
icon: moveUpIcon,
|
|
41048
41918
|
onClick: moveUp,
|
|
41049
41919
|
disabled: isMoveDisabled,
|
|
41050
|
-
'aria-label': ariaLabel
|
|
41920
|
+
'aria-label': ariaLabel('moveUp'),
|
|
41051
41921
|
__parentMetadata: {
|
|
41052
41922
|
parent: props.metaData
|
|
41053
41923
|
}
|
|
@@ -41058,7 +41928,7 @@ var OrderListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
41058
41928
|
icon: moveTopIcon,
|
|
41059
41929
|
onClick: moveTop,
|
|
41060
41930
|
disabled: isMoveDisabled,
|
|
41061
|
-
'aria-label': ariaLabel
|
|
41931
|
+
'aria-label': ariaLabel('moveTop'),
|
|
41062
41932
|
__parentMetadata: {
|
|
41063
41933
|
parent: props.metaData
|
|
41064
41934
|
}
|
|
@@ -41069,7 +41939,7 @@ var OrderListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
41069
41939
|
icon: moveDownIcon,
|
|
41070
41940
|
onClick: moveDown,
|
|
41071
41941
|
disabled: isMoveDisabled,
|
|
41072
|
-
'aria-label': ariaLabel
|
|
41942
|
+
'aria-label': ariaLabel('moveDown'),
|
|
41073
41943
|
__parentMetadata: {
|
|
41074
41944
|
parent: props.metaData
|
|
41075
41945
|
}
|
|
@@ -41080,7 +41950,7 @@ var OrderListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
41080
41950
|
icon: moveBottomIcon,
|
|
41081
41951
|
onClick: moveBottom,
|
|
41082
41952
|
disabled: isMoveDisabled,
|
|
41083
|
-
'aria-label': ariaLabel
|
|
41953
|
+
'aria-label': ariaLabel('moveBottom'),
|
|
41084
41954
|
__parentMetadata: {
|
|
41085
41955
|
parent: props.metaData
|
|
41086
41956
|
}
|
|
@@ -42858,7 +43728,7 @@ var PanelMenuSub = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
42858
43728
|
tabIndex: '-1',
|
|
42859
43729
|
'aria-hidden': true
|
|
42860
43730
|
}, getPTOptions(processedItem, 'action', index));
|
|
42861
|
-
var content = /*#__PURE__*/React.createElement("a", actionProps, submenuIcon, icon, label);
|
|
43731
|
+
var content = /*#__PURE__*/React.createElement("a", actionProps, submenuIcon, icon, label, /*#__PURE__*/React.createElement(Ripple, null));
|
|
42862
43732
|
if (item.template) {
|
|
42863
43733
|
var defaultContentOptions = {
|
|
42864
43734
|
className: linkClassName,
|
|
@@ -44041,17 +44911,19 @@ var Password = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
44041
44911
|
var hideIconProps = mergeProps(ptm('hideIcon'));
|
|
44042
44912
|
var showIconProps = mergeProps(ptm('showIcon'));
|
|
44043
44913
|
if (unmaskedState) {
|
|
44044
|
-
icon = props.hideIcon || /*#__PURE__*/React.createElement(EyeSlashIcon, hideIconProps
|
|
44914
|
+
icon = props.hideIcon || /*#__PURE__*/React.createElement(EyeSlashIcon, _extends({}, hideIconProps, {
|
|
44915
|
+
onClick: toggleMask
|
|
44916
|
+
}));
|
|
44045
44917
|
} else {
|
|
44046
|
-
icon = props.showIcon || /*#__PURE__*/React.createElement(EyeIcon, showIconProps
|
|
44918
|
+
icon = props.showIcon || /*#__PURE__*/React.createElement(EyeIcon, _extends({}, showIconProps, {
|
|
44919
|
+
onClick: toggleMask
|
|
44920
|
+
}));
|
|
44047
44921
|
}
|
|
44048
44922
|
var eyeIcon = IconUtils.getJSXIcon(icon, unmaskedState ? _objectSpread$x({}, hideIconProps) : _objectSpread$x({}, showIconProps), {
|
|
44049
44923
|
props: props
|
|
44050
44924
|
});
|
|
44051
44925
|
if (props.toggleMask) {
|
|
44052
|
-
var content =
|
|
44053
|
-
onClick: toggleMask
|
|
44054
|
-
}, " ", eyeIcon, " ");
|
|
44926
|
+
var content = eyeIcon;
|
|
44055
44927
|
if (props.icon) {
|
|
44056
44928
|
var defaultIconOptions = {
|
|
44057
44929
|
onClick: toggleMask,
|
|
@@ -44370,7 +45242,7 @@ var PickListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44370
45242
|
onClick: moveUp,
|
|
44371
45243
|
pt: ptm('moveUpButton'),
|
|
44372
45244
|
unstyled: unstyled,
|
|
44373
|
-
"aria-label": ariaLabel
|
|
45245
|
+
"aria-label": ariaLabel('moveUp'),
|
|
44374
45246
|
__parentMetadata: {
|
|
44375
45247
|
parent: props.metaData
|
|
44376
45248
|
}
|
|
@@ -44381,7 +45253,7 @@ var PickListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44381
45253
|
onClick: moveTop,
|
|
44382
45254
|
pt: ptm('moveTopButton'),
|
|
44383
45255
|
unstyled: unstyled,
|
|
44384
|
-
"aria-label": ariaLabel
|
|
45256
|
+
"aria-label": ariaLabel('moveTop'),
|
|
44385
45257
|
__parentMetadata: {
|
|
44386
45258
|
parent: props.metaData
|
|
44387
45259
|
}
|
|
@@ -44392,7 +45264,7 @@ var PickListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44392
45264
|
onClick: moveDown,
|
|
44393
45265
|
pt: ptm('moveDownButton'),
|
|
44394
45266
|
unstyled: unstyled,
|
|
44395
|
-
"aria-label": ariaLabel
|
|
45267
|
+
"aria-label": ariaLabel('moveDown'),
|
|
44396
45268
|
__parentMetadata: {
|
|
44397
45269
|
parent: props.metaData
|
|
44398
45270
|
}
|
|
@@ -44403,7 +45275,7 @@ var PickListControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44403
45275
|
onClick: moveBottom,
|
|
44404
45276
|
pt: ptm('moveBottomButton'),
|
|
44405
45277
|
unstyled: unstyled,
|
|
44406
|
-
"aria-label": ariaLabel
|
|
45278
|
+
"aria-label": ariaLabel('moveBottom'),
|
|
44407
45279
|
__parentMetadata: {
|
|
44408
45280
|
parent: props.metaData
|
|
44409
45281
|
}
|
|
@@ -44747,7 +45619,7 @@ var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44747
45619
|
onClick: moveRight,
|
|
44748
45620
|
pt: ptm('moveToTargetButton'),
|
|
44749
45621
|
unstyled: unstyled,
|
|
44750
|
-
"aria-label": ariaLabel
|
|
45622
|
+
"aria-label": ariaLabel('moveToTarget'),
|
|
44751
45623
|
__parentMetadata: {
|
|
44752
45624
|
parent: props.metaData
|
|
44753
45625
|
}
|
|
@@ -44758,7 +45630,7 @@ var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44758
45630
|
onClick: moveAllRight,
|
|
44759
45631
|
pt: ptm('moveAllToTargetButton'),
|
|
44760
45632
|
unstyled: unstyled,
|
|
44761
|
-
"aria-label": ariaLabel
|
|
45633
|
+
"aria-label": ariaLabel('moveAllToTarget'),
|
|
44762
45634
|
__parentMetadata: {
|
|
44763
45635
|
parent: props.metaData
|
|
44764
45636
|
}
|
|
@@ -44769,7 +45641,7 @@ var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44769
45641
|
onClick: moveLeft,
|
|
44770
45642
|
pt: ptm('moveToSourceButton'),
|
|
44771
45643
|
unstyled: unstyled,
|
|
44772
|
-
"aria-label": ariaLabel
|
|
45644
|
+
"aria-label": ariaLabel('moveToSource'),
|
|
44773
45645
|
__parentMetadata: {
|
|
44774
45646
|
parent: props.metaData
|
|
44775
45647
|
}
|
|
@@ -44780,7 +45652,7 @@ var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
|
|
|
44780
45652
|
onClick: moveAllLeft,
|
|
44781
45653
|
pt: ptm('moveAllToSourceButton'),
|
|
44782
45654
|
unstyled: unstyled,
|
|
44783
|
-
"aria-label": ariaLabel
|
|
45655
|
+
"aria-label": ariaLabel('moveAllToSource'),
|
|
44784
45656
|
__parentMetadata: {
|
|
44785
45657
|
parent: props.metaData
|
|
44786
45658
|
}
|
|
@@ -45718,6 +46590,7 @@ var RadioButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
|
|
|
45718
46590
|
onFocus: onFocus,
|
|
45719
46591
|
onBlur: onBlur,
|
|
45720
46592
|
onKeyDown: onKeyDown,
|
|
46593
|
+
checked: props.checked,
|
|
45721
46594
|
disabled: props.disabled,
|
|
45722
46595
|
required: props.required,
|
|
45723
46596
|
tabIndex: props.tabIndex
|
|
@@ -45748,9 +46621,14 @@ RadioButton.displayName = 'RadioButton';
|
|
|
45748
46621
|
var classes$l = {
|
|
45749
46622
|
onIcon: 'p-rating-icon',
|
|
45750
46623
|
item: function item(_ref) {
|
|
45751
|
-
var active = _ref.active
|
|
46624
|
+
var active = _ref.active,
|
|
46625
|
+
value = _ref.value,
|
|
46626
|
+
isFocusVisibleItem = _ref.isFocusVisibleItem,
|
|
46627
|
+
focusedOptionIndex = _ref.focusedOptionIndex;
|
|
45752
46628
|
return classNames('p-rating-item', {
|
|
45753
46629
|
'p-rating-item-active': active
|
|
46630
|
+
}, {
|
|
46631
|
+
'p-focus': value === focusedOptionIndex && isFocusVisibleItem
|
|
45754
46632
|
});
|
|
45755
46633
|
},
|
|
45756
46634
|
cancelIcon: 'p-rating-icon p-rating-cancel',
|
|
@@ -45798,6 +46676,14 @@ var Rating = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
|
|
|
45798
46676
|
var mergeProps = useMergeProps();
|
|
45799
46677
|
var context = React.useContext(PrimeReactContext);
|
|
45800
46678
|
var props = RatingBase.getProps(inProps, context);
|
|
46679
|
+
var _React$useState = React.useState(-1),
|
|
46680
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
46681
|
+
focusedOptionIndex = _React$useState2[0],
|
|
46682
|
+
setFocusedOptionIndex = _React$useState2[1];
|
|
46683
|
+
var _React$useState3 = React.useState(true),
|
|
46684
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
46685
|
+
isFocusVisibleItem = _React$useState4[0];
|
|
46686
|
+
_React$useState4[1];
|
|
45801
46687
|
var elementRef = React.useRef(null);
|
|
45802
46688
|
var _RatingBase$setMetaDa = RatingBase.setMetaData({
|
|
45803
46689
|
props: props
|
|
@@ -45835,6 +46721,7 @@ var Rating = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
|
|
|
45835
46721
|
}
|
|
45836
46722
|
});
|
|
45837
46723
|
}
|
|
46724
|
+
setFocusedOptionIndex(i);
|
|
45838
46725
|
event.preventDefault();
|
|
45839
46726
|
};
|
|
45840
46727
|
var clear = function clear(event) {
|
|
@@ -45858,10 +46745,30 @@ var Rating = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
|
|
|
45858
46745
|
event.preventDefault();
|
|
45859
46746
|
};
|
|
45860
46747
|
var onStarKeyDown = function onStarKeyDown(event, value) {
|
|
45861
|
-
|
|
45862
|
-
|
|
46748
|
+
switch (event.key) {
|
|
46749
|
+
case 'Enter':
|
|
46750
|
+
case 'Space':
|
|
46751
|
+
rate(event, value);
|
|
46752
|
+
event.preventDefault();
|
|
46753
|
+
break;
|
|
46754
|
+
case 'ArrowLeft':
|
|
46755
|
+
case 'ArrowUp':
|
|
46756
|
+
event.preventDefault();
|
|
46757
|
+
rate(event, props.value - 1 < 1 ? props.stars : props.value - 1);
|
|
46758
|
+
break;
|
|
46759
|
+
case 'ArrowRight':
|
|
46760
|
+
case 'ArrowDown':
|
|
46761
|
+
event.preventDefault();
|
|
46762
|
+
rate(event, props.value + 1 > props.stars ? 1 : props.value + 1);
|
|
46763
|
+
break;
|
|
45863
46764
|
}
|
|
45864
46765
|
};
|
|
46766
|
+
var _onFocus = function onFocus(event, value) {
|
|
46767
|
+
setFocusedOptionIndex(value);
|
|
46768
|
+
};
|
|
46769
|
+
var _onBlur = function onBlur(event) {
|
|
46770
|
+
setFocusedOptionIndex(-1);
|
|
46771
|
+
};
|
|
45865
46772
|
var onCancelKeyDown = function onCancelKeyDown(event) {
|
|
45866
46773
|
if (event.key === 'Enter') {
|
|
45867
46774
|
clear(event);
|
|
@@ -45891,14 +46798,24 @@ var Rating = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
|
|
|
45891
46798
|
var itemProps = mergeProps({
|
|
45892
46799
|
key: value,
|
|
45893
46800
|
className: cx('item', {
|
|
45894
|
-
active: active
|
|
46801
|
+
active: active,
|
|
46802
|
+
focusedOptionIndex: focusedOptionIndex,
|
|
46803
|
+
isFocusVisibleItem: isFocusVisibleItem,
|
|
46804
|
+
value: value
|
|
45895
46805
|
}),
|
|
46806
|
+
'data-p-focused': value === focusedOptionIndex,
|
|
45896
46807
|
tabIndex: tabIndex,
|
|
45897
46808
|
onClick: function onClick(e) {
|
|
45898
46809
|
return rate(e, value);
|
|
45899
46810
|
},
|
|
45900
46811
|
onKeyDown: function onKeyDown(e) {
|
|
45901
46812
|
return onStarKeyDown(e, value);
|
|
46813
|
+
},
|
|
46814
|
+
onFocus: function onFocus(e) {
|
|
46815
|
+
return _onFocus(e, value);
|
|
46816
|
+
},
|
|
46817
|
+
onBlur: function onBlur(e) {
|
|
46818
|
+
return _onBlur();
|
|
45902
46819
|
}
|
|
45903
46820
|
}, getPTOptions(props.value, 'item'));
|
|
45904
46821
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
@@ -46507,7 +47424,8 @@ var SelectButtonItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
46507
47424
|
}
|
|
46508
47425
|
});
|
|
46509
47426
|
};
|
|
46510
|
-
var
|
|
47427
|
+
var _onClick = function onClick(event, index) {
|
|
47428
|
+
props.setFocusedIndex(index);
|
|
46511
47429
|
if (props.onClick) {
|
|
46512
47430
|
props.onClick({
|
|
46513
47431
|
originalEvent: event,
|
|
@@ -46521,13 +47439,46 @@ var SelectButtonItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
46521
47439
|
var onBlur = function onBlur() {
|
|
46522
47440
|
setFocusedState(false);
|
|
46523
47441
|
};
|
|
46524
|
-
var
|
|
46525
|
-
|
|
46526
|
-
|
|
46527
|
-
|
|
46528
|
-
|
|
47442
|
+
var _onKeyDown = function onKeyDown(event, index) {
|
|
47443
|
+
switch (event.code) {
|
|
47444
|
+
case 'Space':
|
|
47445
|
+
{
|
|
47446
|
+
_onClick(event, index);
|
|
47447
|
+
event.preventDefault();
|
|
47448
|
+
break;
|
|
47449
|
+
}
|
|
47450
|
+
case 'ArrowDown':
|
|
47451
|
+
case 'ArrowRight':
|
|
47452
|
+
{
|
|
47453
|
+
changeTabIndexes(event, 'next');
|
|
47454
|
+
event.preventDefault();
|
|
47455
|
+
break;
|
|
47456
|
+
}
|
|
47457
|
+
case 'ArrowUp':
|
|
47458
|
+
case 'ArrowLeft':
|
|
47459
|
+
{
|
|
47460
|
+
changeTabIndexes(event, 'prev');
|
|
47461
|
+
event.preventDefault();
|
|
47462
|
+
break;
|
|
47463
|
+
}
|
|
46529
47464
|
}
|
|
46530
47465
|
};
|
|
47466
|
+
var changeTabIndexes = function changeTabIndexes(event, direction) {
|
|
47467
|
+
var firstTabableChild, index;
|
|
47468
|
+
for (var i = 0; i <= props.elementRef.current.children.length - 1; i++) {
|
|
47469
|
+
if (props.elementRef.current.children[i].getAttribute('tabindex') === '0') firstTabableChild = {
|
|
47470
|
+
elem: props.elementRef.current.children[i],
|
|
47471
|
+
index: i
|
|
47472
|
+
};
|
|
47473
|
+
}
|
|
47474
|
+
if (direction === 'prev') {
|
|
47475
|
+
if (firstTabableChild.index === 0) index = props.elementRef.current.children.length - 1;else index = firstTabableChild.index - 1;
|
|
47476
|
+
} else {
|
|
47477
|
+
if (firstTabableChild.index === props.elementRef.current.children.length - 1) index = 0;else index = firstTabableChild.index + 1;
|
|
47478
|
+
}
|
|
47479
|
+
props.setFocusedIndex(index);
|
|
47480
|
+
props.elementRef.current.children[index].focus();
|
|
47481
|
+
};
|
|
46531
47482
|
var createContent = function createContent() {
|
|
46532
47483
|
var labelProps = mergeProps({
|
|
46533
47484
|
className: cx('label')
|
|
@@ -46543,9 +47494,14 @@ var SelectButtonItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
46543
47494
|
role: 'button',
|
|
46544
47495
|
'aria-label': props.label,
|
|
46545
47496
|
'aria-pressed': props.selected,
|
|
46546
|
-
onClick: onClick
|
|
46547
|
-
|
|
47497
|
+
onClick: function onClick(event) {
|
|
47498
|
+
return _onClick(event, props.index);
|
|
47499
|
+
},
|
|
47500
|
+
onKeyDown: function onKeyDown(event) {
|
|
47501
|
+
return _onKeyDown(event, props.index);
|
|
47502
|
+
},
|
|
46548
47503
|
tabIndex: props.tabIndex,
|
|
47504
|
+
'aria-disabled': props.disabled,
|
|
46549
47505
|
onFocus: onFocus,
|
|
46550
47506
|
onBlur: onBlur
|
|
46551
47507
|
}, getPTOptions('button'));
|
|
@@ -46557,6 +47513,10 @@ var SelectButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
46557
47513
|
var mergeProps = useMergeProps();
|
|
46558
47514
|
var context = React.useContext(PrimeReactContext);
|
|
46559
47515
|
var props = SelectButtonBase.getProps(inProps, context);
|
|
47516
|
+
var _React$useState = React.useState(0),
|
|
47517
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
47518
|
+
focusedIndex = _React$useState2[0],
|
|
47519
|
+
setFocusedIndex = _React$useState2[1];
|
|
46560
47520
|
var elementRef = React.useRef(null);
|
|
46561
47521
|
var _SelectButtonBase$set = SelectButtonBase.setMetaData({
|
|
46562
47522
|
props: props
|
|
@@ -46629,7 +47589,7 @@ var SelectButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
46629
47589
|
return props.options.map(function (option, index) {
|
|
46630
47590
|
var isDisabled = props.disabled || isOptionDisabled(option);
|
|
46631
47591
|
var optionLabel = getOptionLabel(option);
|
|
46632
|
-
var tabIndex =
|
|
47592
|
+
var tabIndex = index === focusedIndex ? '0' : '-1';
|
|
46633
47593
|
var selected = isSelected(option);
|
|
46634
47594
|
var key = optionLabel + '_' + index;
|
|
46635
47595
|
return /*#__PURE__*/React.createElement(SelectButtonItem, {
|
|
@@ -46638,13 +47598,16 @@ var SelectButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
46638
47598
|
label: optionLabel,
|
|
46639
47599
|
className: option.className,
|
|
46640
47600
|
option: option,
|
|
47601
|
+
setFocusedIndex: setFocusedIndex,
|
|
46641
47602
|
onClick: onOptionClick,
|
|
46642
47603
|
template: props.itemTemplate,
|
|
46643
47604
|
selected: selected,
|
|
46644
47605
|
tabIndex: tabIndex,
|
|
47606
|
+
index: index,
|
|
46645
47607
|
disabled: isDisabled,
|
|
46646
47608
|
ptm: ptm,
|
|
46647
|
-
cx: cx
|
|
47609
|
+
cx: cx,
|
|
47610
|
+
elementRef: elementRef
|
|
46648
47611
|
});
|
|
46649
47612
|
});
|
|
46650
47613
|
}
|
|
@@ -47736,10 +48699,31 @@ var Slider = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
|
|
|
47736
48699
|
}
|
|
47737
48700
|
handleIndex.current = index;
|
|
47738
48701
|
var key = event.key;
|
|
47739
|
-
|
|
47740
|
-
|
|
47741
|
-
|
|
47742
|
-
|
|
48702
|
+
switch (key) {
|
|
48703
|
+
case 'ArrowRight':
|
|
48704
|
+
case 'ArrowUp':
|
|
48705
|
+
spin(event, 1);
|
|
48706
|
+
break;
|
|
48707
|
+
case 'ArrowLeft':
|
|
48708
|
+
case 'ArrowDown':
|
|
48709
|
+
spin(event, -1);
|
|
48710
|
+
break;
|
|
48711
|
+
case 'PageUp':
|
|
48712
|
+
spin(event, 10);
|
|
48713
|
+
event.preventDefault();
|
|
48714
|
+
break;
|
|
48715
|
+
case 'PageDown':
|
|
48716
|
+
spin(event, -10);
|
|
48717
|
+
event.preventDefault();
|
|
48718
|
+
break;
|
|
48719
|
+
case 'Home':
|
|
48720
|
+
spin(event, -value);
|
|
48721
|
+
event.preventDefault();
|
|
48722
|
+
break;
|
|
48723
|
+
case 'End':
|
|
48724
|
+
spin(event, props.max);
|
|
48725
|
+
event.preventDefault();
|
|
48726
|
+
break;
|
|
47743
48727
|
}
|
|
47744
48728
|
};
|
|
47745
48729
|
var onBarClick = function onBarClick(event) {
|
|
@@ -49942,6 +50926,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
49942
50926
|
var panelSize = function panelSize(sizes, index) {
|
|
49943
50927
|
return index in sizes ? sizes[index] : props.children && [].concat(props.children)[index].props.size || 100 / childrenLength;
|
|
49944
50928
|
};
|
|
50929
|
+
var horizontal = props.layout === 'horizontal';
|
|
49945
50930
|
var metaData = {
|
|
49946
50931
|
props: props,
|
|
49947
50932
|
state: {
|
|
@@ -50036,10 +51021,9 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50036
51021
|
if (stateString) setPanelSizes(JSON.parse(stateString));
|
|
50037
51022
|
}, [getStorage, props.stateKey]);
|
|
50038
51023
|
var onResizeStart = function onResizeStart(event, index, isKeyDown) {
|
|
50039
|
-
gutterRef.current = gutterRefs.current[index];
|
|
50040
51024
|
var pageX = event.type === 'touchstart' ? event.touches[0].pageX : event.pageX;
|
|
50041
51025
|
var pageY = event.type === 'touchstart' ? event.touches[0].pageY : event.pageY;
|
|
50042
|
-
|
|
51026
|
+
gutterRef.current = gutterRefs.current[index];
|
|
50043
51027
|
size.current = horizontal ? DomHandler.getWidth(elementRef.current) : DomHandler.getHeight(elementRef.current);
|
|
50044
51028
|
dragging.current = true;
|
|
50045
51029
|
startPos.current = horizontal ? pageX : pageY;
|
|
@@ -50064,7 +51048,6 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50064
51048
|
var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
50065
51049
|
var isKeyDown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
50066
51050
|
var newPos, newNextPanelSize, newPrevPanelSize;
|
|
50067
|
-
var horizontal = props.layout === 'horizontal';
|
|
50068
51051
|
var pageX = event.type === 'touchmove' ? event.touches[0].pageX : event.pageX;
|
|
50069
51052
|
var pageY = event.type === 'touchmove' ? event.touches[0].pageY : event.pageY;
|
|
50070
51053
|
if (isKeyDown) {
|
|
@@ -50114,7 +51097,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50114
51097
|
switch (event.code) {
|
|
50115
51098
|
case 'ArrowLeft':
|
|
50116
51099
|
{
|
|
50117
|
-
if (
|
|
51100
|
+
if (horizontal) {
|
|
50118
51101
|
setTimer(event, index, props.step * -1);
|
|
50119
51102
|
}
|
|
50120
51103
|
event.preventDefault();
|
|
@@ -50122,7 +51105,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50122
51105
|
}
|
|
50123
51106
|
case 'ArrowRight':
|
|
50124
51107
|
{
|
|
50125
|
-
if (
|
|
51108
|
+
if (horizontal) {
|
|
50126
51109
|
setTimer(event, index, props.step);
|
|
50127
51110
|
}
|
|
50128
51111
|
event.preventDefault();
|
|
@@ -50130,7 +51113,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50130
51113
|
}
|
|
50131
51114
|
case 'ArrowDown':
|
|
50132
51115
|
{
|
|
50133
|
-
if (
|
|
51116
|
+
if (!horizontal) {
|
|
50134
51117
|
setTimer(event, index, props.step * -1);
|
|
50135
51118
|
}
|
|
50136
51119
|
event.preventDefault();
|
|
@@ -50138,7 +51121,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50138
51121
|
}
|
|
50139
51122
|
case 'ArrowUp':
|
|
50140
51123
|
{
|
|
50141
|
-
if (
|
|
51124
|
+
if (!horizontal) {
|
|
50142
51125
|
setTimer(event, index, props.step);
|
|
50143
51126
|
}
|
|
50144
51127
|
event.preventDefault();
|
|
@@ -50158,7 +51141,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50158
51141
|
}
|
|
50159
51142
|
case 'Enter':
|
|
50160
51143
|
{
|
|
50161
|
-
if (prevSize.current >
|
|
51144
|
+
if (prevSize.current > 100 - (minSize || 5)) {
|
|
50162
51145
|
resizePanel(index, minSize, 100);
|
|
50163
51146
|
} else {
|
|
50164
51147
|
resizePanel(index, 100, minSize);
|
|
@@ -50187,14 +51170,16 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50187
51170
|
onResize(event, step, true);
|
|
50188
51171
|
};
|
|
50189
51172
|
var setTimer = function setTimer(event, index, step) {
|
|
50190
|
-
|
|
50191
|
-
|
|
50192
|
-
|
|
50193
|
-
|
|
51173
|
+
if (!timer.current) {
|
|
51174
|
+
timer.current = setInterval(function () {
|
|
51175
|
+
repeat(event, index, step);
|
|
51176
|
+
}, 40);
|
|
51177
|
+
}
|
|
50194
51178
|
};
|
|
50195
51179
|
var clearTimer = function clearTimer() {
|
|
50196
51180
|
if (timer.current) {
|
|
50197
|
-
|
|
51181
|
+
clearInterval(timer.current);
|
|
51182
|
+
timer.current = null;
|
|
50198
51183
|
}
|
|
50199
51184
|
};
|
|
50200
51185
|
var onGutterMouseDown = function onGutterMouseDown(event, index) {
|
|
@@ -50255,7 +51240,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50255
51240
|
return gutterRefs.current[index] = el;
|
|
50256
51241
|
},
|
|
50257
51242
|
className: cx('gutter'),
|
|
50258
|
-
style:
|
|
51243
|
+
style: horizontal ? {
|
|
50259
51244
|
width: props.gutterSize + 'px'
|
|
50260
51245
|
} : {
|
|
50261
51246
|
height: props.gutterSize + 'px'
|
|
@@ -50282,7 +51267,7 @@ var Splitter = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
50282
51267
|
var gutterHandlerProps = mergeProps({
|
|
50283
51268
|
tabIndex: getPanelProp(panel, 'tabIndex') || 0,
|
|
50284
51269
|
className: cx('gutterHandler'),
|
|
50285
|
-
'aria-orientation':
|
|
51270
|
+
'aria-orientation': horizontal ? 'vertical' : 'horizontal',
|
|
50286
51271
|
'aria-controls': panelId,
|
|
50287
51272
|
'aria-label': getPanelProp(panel, 'aria-label'),
|
|
50288
51273
|
'aria-labelledby': getPanelProp(panel, 'aria-labelledby'),
|
|
@@ -51218,8 +52203,10 @@ var TabViewBase = ComponentBase.extend({
|
|
|
51218
52203
|
var TabPanelBase = ComponentBase.extend({
|
|
51219
52204
|
defaultProps: {
|
|
51220
52205
|
__TYPE: 'TabPanel',
|
|
52206
|
+
children: undefined,
|
|
51221
52207
|
className: null,
|
|
51222
52208
|
closable: false,
|
|
52209
|
+
closeIcon: null,
|
|
51223
52210
|
contentClassName: null,
|
|
51224
52211
|
contentStyle: null,
|
|
51225
52212
|
disabled: false,
|
|
@@ -51228,12 +52215,11 @@ var TabPanelBase = ComponentBase.extend({
|
|
|
51228
52215
|
headerStyle: null,
|
|
51229
52216
|
headerTemplate: null,
|
|
51230
52217
|
leftIcon: null,
|
|
51231
|
-
rightIcon: null,
|
|
51232
|
-
prevButton: null,
|
|
51233
52218
|
nextButton: null,
|
|
51234
|
-
|
|
52219
|
+
prevButton: null,
|
|
52220
|
+
rightIcon: null,
|
|
51235
52221
|
style: null,
|
|
51236
|
-
|
|
52222
|
+
visible: true
|
|
51237
52223
|
},
|
|
51238
52224
|
getCProp: function getCProp(tab, name) {
|
|
51239
52225
|
return ObjectUtils.getComponentProp(tab, name, TabPanelBase.defaultProps);
|
|
@@ -51327,7 +52313,7 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
51327
52313
|
return TabPanelBase.getCProp(tab, name);
|
|
51328
52314
|
};
|
|
51329
52315
|
var shouldUseTab = function shouldUseTab(tab) {
|
|
51330
|
-
return tab && ObjectUtils.isValidChild(tab, 'TabPanel') && hiddenTabsState.every(function (_i) {
|
|
52316
|
+
return tab && getTabProp(tab, 'visible') && ObjectUtils.isValidChild(tab, 'TabPanel') && hiddenTabsState.every(function (_i) {
|
|
51331
52317
|
return _i !== tab.key;
|
|
51332
52318
|
});
|
|
51333
52319
|
};
|
|
@@ -51745,7 +52731,7 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
51745
52731
|
ref: prevBtnRef,
|
|
51746
52732
|
type: 'button',
|
|
51747
52733
|
className: cx('prevbutton'),
|
|
51748
|
-
'aria-label': ariaLabel
|
|
52734
|
+
'aria-label': ariaLabel('previousPageLabel'),
|
|
51749
52735
|
onClick: function onClick(e) {
|
|
51750
52736
|
return navBackward();
|
|
51751
52737
|
}
|
|
@@ -51767,7 +52753,7 @@ var TabView = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
51767
52753
|
ref: nextBtnRef,
|
|
51768
52754
|
type: 'button',
|
|
51769
52755
|
className: cx('nextbutton'),
|
|
51770
|
-
'aria-label': ariaLabel
|
|
52756
|
+
'aria-label': ariaLabel('nextPageLabel'),
|
|
51771
52757
|
onClick: function onClick(e) {
|
|
51772
52758
|
return navForward();
|
|
51773
52759
|
}
|
|
@@ -52605,14 +53591,13 @@ var ToggleButtonBase = ComponentBase.extend({
|
|
|
52605
53591
|
function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
52606
53592
|
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
52607
53593
|
var ToggleButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
53594
|
+
var context = React.useContext(PrimeReactContext);
|
|
53595
|
+
var props = ToggleButtonBase.getProps(inProps, context);
|
|
53596
|
+
var elementRef = React.useRef(null);
|
|
52608
53597
|
var _React$useState = React.useState(false),
|
|
52609
53598
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
52610
53599
|
focusedState = _React$useState2[0],
|
|
52611
53600
|
setFocusedState = _React$useState2[1];
|
|
52612
|
-
var mergeProps = useMergeProps();
|
|
52613
|
-
var context = React.useContext(PrimeReactContext);
|
|
52614
|
-
var props = ToggleButtonBase.getProps(inProps, context);
|
|
52615
|
-
var elementRef = React.useRef(null);
|
|
52616
53601
|
var _ToggleButtonBase$set = ToggleButtonBase.setMetaData({
|
|
52617
53602
|
props: props,
|
|
52618
53603
|
state: {
|
|
@@ -52648,6 +53633,12 @@ var ToggleButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
52648
53633
|
});
|
|
52649
53634
|
}
|
|
52650
53635
|
};
|
|
53636
|
+
var onKeyDown = function onKeyDown(event) {
|
|
53637
|
+
if (event.keyCode === 32) {
|
|
53638
|
+
toggle(event);
|
|
53639
|
+
event.preventDefault();
|
|
53640
|
+
}
|
|
53641
|
+
};
|
|
52651
53642
|
var onFocus = function onFocus(event) {
|
|
52652
53643
|
setFocusedState(true);
|
|
52653
53644
|
props.onFocus && props.onFocus(event);
|
|
@@ -52656,12 +53647,6 @@ var ToggleButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
52656
53647
|
setFocusedState(false);
|
|
52657
53648
|
props.onBlur && props.onBlur(event);
|
|
52658
53649
|
};
|
|
52659
|
-
var onKeyDown = function onKeyDown(event) {
|
|
52660
|
-
if (event.keyCode === 32) {
|
|
52661
|
-
toggle(event);
|
|
52662
|
-
event.preventDefault();
|
|
52663
|
-
}
|
|
52664
|
-
};
|
|
52665
53650
|
var createIcon = function createIcon() {
|
|
52666
53651
|
if (hasIcon) {
|
|
52667
53652
|
var iconProps = mergeProps({
|
|
@@ -52711,7 +53696,9 @@ var ToggleButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
52711
53696
|
onKeyDown: onKeyDown,
|
|
52712
53697
|
tabIndex: tabIndex,
|
|
52713
53698
|
role: 'button',
|
|
52714
|
-
'aria-pressed': props.checked
|
|
53699
|
+
'aria-pressed': props.checked,
|
|
53700
|
+
'data-p-highlight': props.checked,
|
|
53701
|
+
'data-p-disabled': props.disabled
|
|
52715
53702
|
}, ToggleButtonBase.getOtherProps(props), ptm('root'));
|
|
52716
53703
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", rootProps, iconElement, /*#__PURE__*/React.createElement("span", labelProps, label), /*#__PURE__*/React.createElement(Ripple, null)), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
52717
53704
|
target: elementRef,
|
|
@@ -55977,7 +56964,7 @@ var TreeTableRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
55977
56964
|
return props.selectionKeys ? props.selectionKeys[props.node.key] && props.selectionKeys[props.node.key].partialChecked : false;
|
|
55978
56965
|
};
|
|
55979
56966
|
var createToggler = function createToggler(column) {
|
|
55980
|
-
var label = expanded ? ariaLabel
|
|
56967
|
+
var label = expanded ? ariaLabel('collapseLabel') : ariaLabel('expandLabel');
|
|
55981
56968
|
var rowTogglerIconProps = mergeProps({
|
|
55982
56969
|
className: cx('rowTogglerIcon'),
|
|
55983
56970
|
'aria-hidden': true
|
|
@@ -58218,7 +59205,7 @@ var TriStateCheckbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
58218
59205
|
setFocusedState(false);
|
|
58219
59206
|
};
|
|
58220
59207
|
var onKeyDown = function onKeyDown(e) {
|
|
58221
|
-
if (e.
|
|
59208
|
+
if (e.code === 'Enter' || e.code === 'Space') {
|
|
58222
59209
|
toggle(e);
|
|
58223
59210
|
e.preventDefault();
|
|
58224
59211
|
}
|
|
@@ -58257,7 +59244,7 @@ var TriStateCheckbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
58257
59244
|
var checkIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, checkIconProps), {
|
|
58258
59245
|
props: props
|
|
58259
59246
|
});
|
|
58260
|
-
var ariaValueLabel = props.value ? ariaLabel
|
|
59247
|
+
var ariaValueLabel = props.value ? ariaLabel('trueLabel') : props.value === false ? ariaLabel('falseLabel') : ariaLabel('nullLabel');
|
|
58261
59248
|
var ariaChecked = props.value ? 'true' : 'false';
|
|
58262
59249
|
var checkboxProps = mergeProps(_objectSpread({
|
|
58263
59250
|
className: cx('checkbox', {
|
|
@@ -58277,7 +59264,8 @@ var TriStateCheckbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
58277
59264
|
var rootProps = mergeProps({
|
|
58278
59265
|
className: classNames(props.className, cx('root')),
|
|
58279
59266
|
style: props.style,
|
|
58280
|
-
onClick: onClick
|
|
59267
|
+
onClick: onClick,
|
|
59268
|
+
'data-p-disabled': props.disabled
|
|
58281
59269
|
}, TriStateCheckboxBase.getOtherProps(props), ptm('root'));
|
|
58282
59270
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
58283
59271
|
id: props.id,
|
|
@@ -58291,4 +59279,4 @@ var TriStateCheckbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fu
|
|
|
58291
59279
|
}));
|
|
58292
59280
|
TriStateCheckbox.displayName = 'TriStateCheckbox';
|
|
58293
59281
|
|
|
58294
|
-
export { Accordion, AccordionTab, AngleDoubleDownIcon, AngleDoubleLeftIcon, AngleDoubleRightIcon, AngleDoubleUpIcon, AngleDownIcon, AngleLeftIcon, AngleRightIcon, AngleUpIcon, ArrowDownIcon, ArrowUpIcon, AutoComplete, Avatar, AvatarGroup, Badge, BanIcon, BarsIcon, BlockUI, BreadCrumb, Button, CSSTransition, Calendar, CalendarIcon, Card, Carousel, CascadeSelect, PrimeReactChart as Chart, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, Chips, ColorPicker, Column, ColumnGroup, ConfirmDialog, ConfirmPopup, ContextMenu, DataScroller, DataTable, DataView, DataViewItem, DataViewLayoutOptions, DeferredContent, Dialog, Divider, Dock, DomHandler, Dropdown, ESC_KEY_HANDLING_PRIORITIES, Editor, EventBus, ExclamationTriangleIcon, EyeIcon, EyeSlashIcon, Fieldset, FileUpload, FilterIcon, FilterMatchMode, FilterOperator, FilterService, FilterSlashIcon, Galleria, IconBase, IconUtils, Image, InfoCircleIcon, Inplace, InplaceContent, InplaceDisplay, InputMask, InputNumber, InputSwitch, InputText, InputTextarea, KeyFilter, Knob, ListBox, MegaMenu, Mention, Menu, Menubar, Message, MessageSeverity, Messages, MinusIcon, MultiSelect, MultiStateCheckbox, ObjectUtils, OrderList, OrganizationChart, OverlayPanel, OverlayService, Paginator, Panel, PanelMenu, Password, PencilIcon, PickList, PlusIcon, Portal, PrimeIcons, PrimeReactContext, PrimeReactProvider, ProgressBar, ProgressSpinner, RadioButton, Rating, RefreshIcon, Ripple, Row, ScrollPanel, ScrollTop, SearchIcon, SearchMinusIcon, SearchPlusIcon, SelectButton, Sidebar, Skeleton, SlideMenu, Slider, SortAltIcon, SortAmountDownIcon, SortAmountUpAltIcon, SortOrder, SpeedDial, SpinnerIcon, SplitButton, Splitter, SplitterPanel, StarFillIcon, StarIcon, Steps, StyleClass, TabMenu, TabPanel, TabView, Tag, Terminal, TerminalService, ThLargeIcon, TieredMenu, Timeline, TimesCircleIcon, TimesIcon, Toast, ToggleButton, Toolbar, Tooltip, TrashIcon, Tree, TreeSelect, TreeTable, TriStateCheckbox, UndoIcon, UniqueComponentId, UploadIcon, VirtualScroller, WindowMaximizeIcon, WindowMinimizeIcon, ZIndexUtils, _mergeProps, addLocale, ariaLabel
|
|
59282
|
+
export { Accordion, AccordionTab, AngleDoubleDownIcon, AngleDoubleLeftIcon, AngleDoubleRightIcon, AngleDoubleUpIcon, AngleDownIcon, AngleLeftIcon, AngleRightIcon, AngleUpIcon, ArrowDownIcon, ArrowUpIcon, AutoComplete, Avatar, AvatarGroup, Badge, BanIcon, BarsIcon, BlockUI, BreadCrumb, Button, CSSTransition, Calendar, CalendarIcon, Card, Carousel, CascadeSelect, PrimeReactChart as Chart, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, Chips, ColorPicker, Column, ColumnGroup, ConfirmDialog, ConfirmPopup, ContextMenu, DataScroller, DataTable, DataView, DataViewItem, DataViewLayoutOptions, DeferredContent, Dialog, Divider, Dock, DomHandler, Dropdown, ESC_KEY_HANDLING_PRIORITIES, Editor, EventBus, ExclamationTriangleIcon, EyeIcon, EyeSlashIcon, Fieldset, FileUpload, FilterIcon, FilterMatchMode, FilterOperator, FilterService, FilterSlashIcon, Galleria, IconBase, IconUtils, Image, InfoCircleIcon, Inplace, InplaceContent, InplaceDisplay, InputMask, InputNumber, InputSwitch, InputText, InputTextarea, KeyFilter, Knob, ListBox, MegaMenu, Mention, Menu, Menubar, Message, MessageSeverity, Messages, MinusIcon, MultiSelect, MultiStateCheckbox, ObjectUtils, OrderList, OrganizationChart, OverlayPanel, OverlayService, Paginator, Panel, PanelMenu, Password, PencilIcon, PickList, PlusIcon, Portal, PrimeIcons, PrimeReactContext, PrimeReactProvider, ProgressBar, ProgressSpinner, RadioButton, Rating, RefreshIcon, Ripple, Row, ScrollPanel, ScrollTop, SearchIcon, SearchMinusIcon, SearchPlusIcon, SelectButton, Sidebar, Skeleton, SlideMenu, Slider, SortAltIcon, SortAmountDownIcon, SortAmountUpAltIcon, SortOrder, SpeedDial, SpinnerIcon, SplitButton, Splitter, SplitterPanel, StarFillIcon, StarIcon, Steps, StyleClass, TabMenu, TabPanel, TabView, Tag, Terminal, TerminalService, ThLargeIcon, TieredMenu, Timeline, TimesCircleIcon, TimesIcon, Toast, ToggleButton, Toolbar, Tooltip, TrashIcon, Tree, TreeSelect, TreeTable, TriStateCheckbox, UndoIcon, UniqueComponentId, UploadIcon, VirtualScroller, WindowMaximizeIcon, WindowMinimizeIcon, ZIndexUtils, _mergeProps, addLocale, ariaLabel, classNames, confirmDialog, confirmPopup, PrimeReact as default, locale, localeOption, localeOptions, mask, mergeProps, updateLocaleOption, updateLocaleOptions, useClickOutside, useCounter, useDebounce, useDisplayOrder, useEventListener, useFavicon, useGlobalOnEscapeKey, useIntersectionObserver, useInterval, useLocalStorage, useMatchMedia, useMergeProps, useMountEffect, useMouse, useMove, useOverlayListener, useOverlayScrollListener, usePrevious, useResizeListener, useSessionStorage, useStorage, useStyle, useTimeout, useUnmountEffect, useUpdateEffect };
|