@patternfly/react-core 4.201.2 → 4.202.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/CHANGELOG.md +11 -0
- package/dist/esm/components/Menu/MenuContent.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuContent.js +21 -2
- package/dist/esm/components/Menu/MenuContent.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +5 -3
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +36 -17
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/SelectOption.d.ts.map +1 -1
- package/dist/esm/components/Select/SelectOption.js +3 -3
- package/dist/esm/components/Select/SelectOption.js.map +1 -1
- package/dist/esm/components/Select/SelectToggle.d.ts +1 -1
- package/dist/esm/components/Select/SelectToggle.d.ts.map +1 -1
- package/dist/esm/components/Select/SelectToggle.js +14 -14
- package/dist/esm/components/Select/SelectToggle.js.map +1 -1
- package/dist/esm/components/Select/selectConstants.d.ts +1 -0
- package/dist/esm/components/Select/selectConstants.d.ts.map +1 -1
- package/dist/esm/components/Select/selectConstants.js.map +1 -1
- package/dist/esm/components/TimePicker/TimePicker.d.ts +6 -4
- package/dist/esm/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/esm/components/TimePicker/TimePicker.js +15 -8
- package/dist/esm/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/js/components/Menu/MenuContent.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuContent.js +21 -2
- package/dist/js/components/Menu/MenuContent.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +5 -3
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +36 -17
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Select/SelectOption.d.ts.map +1 -1
- package/dist/js/components/Select/SelectOption.js +3 -3
- package/dist/js/components/Select/SelectOption.js.map +1 -1
- package/dist/js/components/Select/SelectToggle.d.ts +1 -1
- package/dist/js/components/Select/SelectToggle.d.ts.map +1 -1
- package/dist/js/components/Select/SelectToggle.js +14 -14
- package/dist/js/components/Select/SelectToggle.js.map +1 -1
- package/dist/js/components/Select/selectConstants.d.ts +1 -0
- package/dist/js/components/Select/selectConstants.d.ts.map +1 -1
- package/dist/js/components/Select/selectConstants.js.map +1 -1
- package/dist/js/components/TimePicker/TimePicker.d.ts +6 -4
- package/dist/js/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/js/components/TimePicker/TimePicker.js +15 -8
- package/dist/js/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/umd/react-core.css +31 -2
- package/dist/umd/react-core.js +96 -46
- package/dist/umd/react-core.min.css +31 -2
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +6 -6
- package/src/components/Menu/MenuContent.tsx +27 -2
- package/src/components/Select/Select.tsx +39 -18
- package/src/components/Select/SelectOption.tsx +7 -4
- package/src/components/Select/SelectToggle.tsx +15 -15
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +2 -0
- package/src/components/Select/examples/Select.md +93 -40
- package/src/components/Select/selectConstants.tsx +1 -0
- package/src/components/TimePicker/TimePicker.tsx +20 -11
- package/src/components/TimePicker/examples/TimePicker.md +2 -0
package/dist/umd/react-core.js
CHANGED
|
@@ -6190,7 +6190,7 @@
|
|
|
6190
6190
|
setViewMoreNextIndex();
|
|
6191
6191
|
onClick(event);
|
|
6192
6192
|
};
|
|
6193
|
-
const renderOption = (onSelect, onClose, variant, inputIdPrefix, onFavorite) => {
|
|
6193
|
+
const renderOption = (onSelect, onClose, variant, inputIdPrefix, onFavorite, shouldResetOnSelect) => {
|
|
6194
6194
|
if (variant !== exports.SelectVariant.checkbox && isLoading && isGrouped) {
|
|
6195
6195
|
return (React__namespace.createElement("div", { role: "presentation", className: css(_default$13.selectListItem, isLoading && _default$13.modifiers.loading, className) }, children));
|
|
6196
6196
|
}
|
|
@@ -6215,7 +6215,7 @@
|
|
|
6215
6215
|
if (!isDisabled) {
|
|
6216
6216
|
onClick(event);
|
|
6217
6217
|
onSelect(event, value, isPlaceholder);
|
|
6218
|
-
onClose();
|
|
6218
|
+
shouldResetOnSelect && onClose();
|
|
6219
6219
|
}
|
|
6220
6220
|
}, role: "option", "aria-selected": isSelected || null, ref: this.ref, onKeyDown: (event) => {
|
|
6221
6221
|
this.onKeyDown(event, 0);
|
|
@@ -6263,7 +6263,7 @@
|
|
|
6263
6263
|
}, type: "button" }), itemDisplay)));
|
|
6264
6264
|
}
|
|
6265
6265
|
};
|
|
6266
|
-
return (React__namespace.createElement(SelectConsumer, null, ({ onSelect, onClose, variant, inputIdPrefix, onFavorite }) => (React__namespace.createElement(React__namespace.Fragment, null, renderOption(onSelect, onClose, variant, inputIdPrefix, onFavorite)))));
|
|
6266
|
+
return (React__namespace.createElement(SelectConsumer, null, ({ onSelect, onClose, variant, inputIdPrefix, onFavorite, shouldResetOnSelect }) => (React__namespace.createElement(React__namespace.Fragment, null, renderOption(onSelect, onClose, variant, inputIdPrefix, onFavorite, shouldResetOnSelect)))));
|
|
6267
6267
|
}
|
|
6268
6268
|
}
|
|
6269
6269
|
SelectOption.displayName = 'SelectOption';
|
|
@@ -6450,7 +6450,7 @@
|
|
|
6450
6450
|
const clickedOnToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
|
|
6451
6451
|
const clickedWithinMenu = menuRef && menuRef.current && menuRef.current.contains && menuRef.current.contains(event.target);
|
|
6452
6452
|
if (isOpen && !(clickedOnToggle || clickedWithinMenu)) {
|
|
6453
|
-
onToggle(false);
|
|
6453
|
+
onToggle(false, event);
|
|
6454
6454
|
onClose();
|
|
6455
6455
|
}
|
|
6456
6456
|
};
|
|
@@ -6469,7 +6469,7 @@
|
|
|
6469
6469
|
const tabbableItems = findTabbableElements(footerRef, SelectFooterTabbableItems);
|
|
6470
6470
|
// If no tabbable item in footer close select
|
|
6471
6471
|
if (tabbableItems.length <= 0) {
|
|
6472
|
-
onToggle(false);
|
|
6472
|
+
onToggle(false, event);
|
|
6473
6473
|
onClose();
|
|
6474
6474
|
this.toggle.current.focus();
|
|
6475
6475
|
return;
|
|
@@ -6481,7 +6481,7 @@
|
|
|
6481
6481
|
if (event.shiftKey) {
|
|
6482
6482
|
if (variant !== 'checkbox') {
|
|
6483
6483
|
// only close non checkbox variation on shift clicked
|
|
6484
|
-
onToggle(false);
|
|
6484
|
+
onToggle(false, event);
|
|
6485
6485
|
onClose();
|
|
6486
6486
|
this.toggle.current.focus();
|
|
6487
6487
|
}
|
|
@@ -6507,7 +6507,7 @@
|
|
|
6507
6507
|
}
|
|
6508
6508
|
else {
|
|
6509
6509
|
// no more footer items close menu
|
|
6510
|
-
onToggle(false);
|
|
6510
|
+
onToggle(false, event);
|
|
6511
6511
|
onClose();
|
|
6512
6512
|
this.toggle.current.focus();
|
|
6513
6513
|
}
|
|
@@ -6518,7 +6518,7 @@
|
|
|
6518
6518
|
if (isOpen &&
|
|
6519
6519
|
(event.key === KeyTypes.Escape || event.key === KeyTypes.Tab) &&
|
|
6520
6520
|
(escFromToggle || escFromWithinMenu)) {
|
|
6521
|
-
onToggle(false);
|
|
6521
|
+
onToggle(false, event);
|
|
6522
6522
|
onClose();
|
|
6523
6523
|
this.toggle.current.focus();
|
|
6524
6524
|
}
|
|
@@ -6535,7 +6535,7 @@
|
|
|
6535
6535
|
handleTypeaheadKeys('enter');
|
|
6536
6536
|
}
|
|
6537
6537
|
else {
|
|
6538
|
-
onToggle(!isOpen);
|
|
6538
|
+
onToggle(!isOpen, event);
|
|
6539
6539
|
}
|
|
6540
6540
|
}
|
|
6541
6541
|
}
|
|
@@ -6547,12 +6547,12 @@
|
|
|
6547
6547
|
}
|
|
6548
6548
|
event.preventDefault();
|
|
6549
6549
|
if ((event.key === KeyTypes.Tab || event.key === KeyTypes.Enter || event.key === KeyTypes.Space) && isOpen) {
|
|
6550
|
-
onToggle(!isOpen);
|
|
6550
|
+
onToggle(!isOpen, event);
|
|
6551
6551
|
onClose();
|
|
6552
6552
|
this.toggle.current.focus();
|
|
6553
6553
|
}
|
|
6554
6554
|
else if ((event.key === KeyTypes.Enter || event.key === KeyTypes.Space) && !isOpen) {
|
|
6555
|
-
onToggle(!isOpen);
|
|
6555
|
+
onToggle(!isOpen, event);
|
|
6556
6556
|
onEnter();
|
|
6557
6557
|
}
|
|
6558
6558
|
};
|
|
@@ -6584,8 +6584,8 @@
|
|
|
6584
6584
|
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
6585
6585
|
!isTypeahead && (React__namespace.createElement("button", Object.assign({}, props, toggleProps, { ref: this.toggle, type: type, className: css(_default$13.selectToggle, hasPlaceholderStyle && _default$13.modifiers.placeholder, isDisabled && _default$13.modifiers.disabled, isPlain && _default$13.modifiers.plain, isActive && _default$13.modifiers.active, className), "aria-label": ariaLabel,
|
|
6586
6586
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6587
|
-
onClick:
|
|
6588
|
-
onToggle(!isOpen);
|
|
6587
|
+
onClick: event => {
|
|
6588
|
+
onToggle(!isOpen, event);
|
|
6589
6589
|
if (isOpen) {
|
|
6590
6590
|
onClose();
|
|
6591
6591
|
}
|
|
@@ -6595,17 +6595,17 @@
|
|
|
6595
6595
|
React__namespace.createElement(CaretDownIcon$1, null)))),
|
|
6596
6596
|
isTypeahead && (React__namespace.createElement("div", Object.assign({}, props, { ref: this.toggle, className: css(_default$13.selectToggle, hasPlaceholderStyle && _default$13.modifiers.placeholder, isDisabled && _default$13.modifiers.disabled, isPlain && _default$13.modifiers.plain, isTypeahead && _default$13.modifiers.typeahead, className),
|
|
6597
6597
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6598
|
-
onClick:
|
|
6598
|
+
onClick: event => {
|
|
6599
6599
|
if (!isDisabled) {
|
|
6600
|
-
onToggle(!isOpen);
|
|
6600
|
+
onToggle(!isOpen, event);
|
|
6601
6601
|
if (isOpen) {
|
|
6602
6602
|
onClose();
|
|
6603
6603
|
}
|
|
6604
6604
|
}
|
|
6605
6605
|
}, onKeyDown: this.onKeyDown }),
|
|
6606
6606
|
children,
|
|
6607
|
-
React__namespace.createElement("button", Object.assign({}, toggleProps, { type: type, className: css(_default$1l.button, _default$13.selectToggleButton, _default$13.modifiers.plain), "aria-label": ariaLabel, onClick:
|
|
6608
|
-
onToggle(!isOpen);
|
|
6607
|
+
React__namespace.createElement("button", Object.assign({}, toggleProps, { type: type, className: css(_default$1l.button, _default$13.selectToggleButton, _default$13.modifiers.plain), "aria-label": ariaLabel, onClick: event => {
|
|
6608
|
+
onToggle(!isOpen, event);
|
|
6609
6609
|
if (isOpen) {
|
|
6610
6610
|
onClose();
|
|
6611
6611
|
}
|
|
@@ -6872,7 +6872,7 @@
|
|
|
6872
6872
|
this.onEnter = () => {
|
|
6873
6873
|
this.setState({ focusFirstOption: true });
|
|
6874
6874
|
};
|
|
6875
|
-
this.onToggle = (isExpanded) => {
|
|
6875
|
+
this.onToggle = (isExpanded, e) => {
|
|
6876
6876
|
const { isInputValuePersisted, onSelect, onToggle, hasInlineFilter } = this.props;
|
|
6877
6877
|
if (!isExpanded && isInputValuePersisted && onSelect) {
|
|
6878
6878
|
onSelect(undefined, this.inputRef.current ? this.inputRef.current.value : '');
|
|
@@ -6882,7 +6882,7 @@
|
|
|
6882
6882
|
focusFirstOption: true
|
|
6883
6883
|
});
|
|
6884
6884
|
}
|
|
6885
|
-
onToggle(isExpanded);
|
|
6885
|
+
onToggle(isExpanded, e);
|
|
6886
6886
|
};
|
|
6887
6887
|
this.onClose = () => {
|
|
6888
6888
|
const { isInputFilterPersisted } = this.props;
|
|
@@ -6892,7 +6892,7 @@
|
|
|
6892
6892
|
};
|
|
6893
6893
|
this.onChange = (e) => {
|
|
6894
6894
|
if (e.target.value.toString() !== '' && !this.props.isOpen) {
|
|
6895
|
-
this.onToggle(true);
|
|
6895
|
+
this.onToggle(true, e);
|
|
6896
6896
|
}
|
|
6897
6897
|
if (this.props.onTypeaheadInputChanged) {
|
|
6898
6898
|
this.props.onTypeaheadInputChanged(e.target.value.toString());
|
|
@@ -7004,9 +7004,9 @@
|
|
|
7004
7004
|
typeaheadFilteredChildren
|
|
7005
7005
|
});
|
|
7006
7006
|
};
|
|
7007
|
-
this.onClick = (
|
|
7007
|
+
this.onClick = (e) => {
|
|
7008
7008
|
if (!this.props.isOpen) {
|
|
7009
|
-
this.onToggle(true);
|
|
7009
|
+
this.onToggle(true, e);
|
|
7010
7010
|
}
|
|
7011
7011
|
};
|
|
7012
7012
|
this.clearSelection = (_e) => {
|
|
@@ -7083,9 +7083,20 @@
|
|
|
7083
7083
|
if (position === 'enter') {
|
|
7084
7084
|
if (typeaheadCurrIndex !== -1 && // do not allow selection without moving to an initial option
|
|
7085
7085
|
(typeaheadActiveChild || (this.refCollection[0] && this.refCollection[0][0]))) {
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7086
|
+
if (typeaheadActiveChild) {
|
|
7087
|
+
const hasDescriptionElm = typeaheadActiveChild.childElementCount > 1;
|
|
7088
|
+
const typeaheadActiveChildText = hasDescriptionElm
|
|
7089
|
+
? typeaheadActiveChild.firstChild.innerText
|
|
7090
|
+
: typeaheadActiveChild.innerText;
|
|
7091
|
+
this.setState({
|
|
7092
|
+
typeaheadInputValue: typeaheadActiveChildText
|
|
7093
|
+
});
|
|
7094
|
+
}
|
|
7095
|
+
else {
|
|
7096
|
+
this.setState({
|
|
7097
|
+
typeaheadInputValue: this.refCollection[0][0].innerText
|
|
7098
|
+
});
|
|
7099
|
+
}
|
|
7089
7100
|
if (typeaheadActiveChild) {
|
|
7090
7101
|
typeaheadActiveChild.click();
|
|
7091
7102
|
}
|
|
@@ -7171,7 +7182,7 @@
|
|
|
7171
7182
|
else {
|
|
7172
7183
|
// Close if there is no footer
|
|
7173
7184
|
if (!this.props.footer) {
|
|
7174
|
-
this.onToggle(false);
|
|
7185
|
+
this.onToggle(false, null);
|
|
7175
7186
|
this.onClose();
|
|
7176
7187
|
}
|
|
7177
7188
|
else {
|
|
@@ -7181,7 +7192,7 @@
|
|
|
7181
7192
|
if (this.inputRef.current === document.activeElement) {
|
|
7182
7193
|
if (shiftKey) {
|
|
7183
7194
|
// close toggle if shift key and tab on input
|
|
7184
|
-
this.onToggle(false);
|
|
7195
|
+
this.onToggle(false, null);
|
|
7185
7196
|
this.onClose();
|
|
7186
7197
|
}
|
|
7187
7198
|
else {
|
|
@@ -7190,7 +7201,7 @@
|
|
|
7190
7201
|
tabbableItems[0].focus();
|
|
7191
7202
|
}
|
|
7192
7203
|
else {
|
|
7193
|
-
this.onToggle(false);
|
|
7204
|
+
this.onToggle(false, null);
|
|
7194
7205
|
this.onClose();
|
|
7195
7206
|
}
|
|
7196
7207
|
}
|
|
@@ -7214,7 +7225,7 @@
|
|
|
7214
7225
|
}
|
|
7215
7226
|
else {
|
|
7216
7227
|
// no next item, close toggle
|
|
7217
|
-
this.onToggle(false);
|
|
7228
|
+
this.onToggle(false, null);
|
|
7218
7229
|
this.inputRef.current.focus();
|
|
7219
7230
|
this.onClose();
|
|
7220
7231
|
}
|
|
@@ -7383,7 +7394,7 @@
|
|
|
7383
7394
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
7384
7395
|
menuAppendTo, favorites, onFavorite,
|
|
7385
7396
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7386
|
-
favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "toggleId", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "clearSelectionsAriaLabel", "toggleAriaLabel", "removeSelectionAriaLabel", 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-invalid', "placeholderText", "width", "maxHeight", "toggleIcon", "ouiaId", "ouiaSafe", "hasInlineFilter", "isCheckboxSelectionBadgeHidden", "inlineFilterPlaceholderText", "onFilter", "onTypeaheadInputChanged", "onCreateOption", "isCreatable", "onToggle", "createText", "noResultsFoundText", "customBadgeText", "inputIdPrefix", "inputAutoComplete", "isInputValuePersisted", "isInputFilterPersisted", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject"]);
|
|
7397
|
+
favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject, shouldResetOnSelect } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "toggleId", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "clearSelectionsAriaLabel", "toggleAriaLabel", "removeSelectionAriaLabel", 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-invalid', "placeholderText", "width", "maxHeight", "toggleIcon", "ouiaId", "ouiaSafe", "hasInlineFilter", "isCheckboxSelectionBadgeHidden", "inlineFilterPlaceholderText", "onFilter", "onTypeaheadInputChanged", "onCreateOption", "isCreatable", "onToggle", "createText", "noResultsFoundText", "customBadgeText", "inputIdPrefix", "inputAutoComplete", "isInputValuePersisted", "isInputFilterPersisted", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject", "shouldResetOnSelect"]);
|
|
7387
7398
|
const { focusFirstOption: openedOnEnter, typeaheadCurrIndex, typeaheadInputValue, typeaheadFilteredChildren, favoritesGroup } = this.state;
|
|
7388
7399
|
const selectToggleId = toggleId || `pf-select-toggle-id-${currentId$1++}`;
|
|
7389
7400
|
const selections = Array.isArray(selectionsProp) ? selectionsProp : [selectionsProp];
|
|
@@ -7468,7 +7479,7 @@
|
|
|
7468
7479
|
else if (event.key === KeyTypes.Tab && variant !== exports.SelectVariant.checkbox && this.props.footer) {
|
|
7469
7480
|
// tab to footer or close menu if shift key
|
|
7470
7481
|
if (event.shiftKey) {
|
|
7471
|
-
this.onToggle(false);
|
|
7482
|
+
this.onToggle(false, event);
|
|
7472
7483
|
}
|
|
7473
7484
|
else {
|
|
7474
7485
|
const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
|
|
@@ -7478,7 +7489,7 @@
|
|
|
7478
7489
|
event.preventDefault();
|
|
7479
7490
|
}
|
|
7480
7491
|
else {
|
|
7481
|
-
this.onToggle(false);
|
|
7492
|
+
this.onToggle(false, event);
|
|
7482
7493
|
}
|
|
7483
7494
|
}
|
|
7484
7495
|
}
|
|
@@ -7598,7 +7609,14 @@
|
|
|
7598
7609
|
}
|
|
7599
7610
|
return null;
|
|
7600
7611
|
};
|
|
7601
|
-
return (React__namespace.createElement(GenerateId, null, randomId => (React__namespace.createElement(SelectContext.Provider, { value: {
|
|
7612
|
+
return (React__namespace.createElement(GenerateId, null, randomId => (React__namespace.createElement(SelectContext.Provider, { value: {
|
|
7613
|
+
onSelect,
|
|
7614
|
+
onFavorite,
|
|
7615
|
+
onClose: this.onClose,
|
|
7616
|
+
variant,
|
|
7617
|
+
inputIdPrefix: inputIdPrefix || randomId,
|
|
7618
|
+
shouldResetOnSelect
|
|
7619
|
+
} }, menuAppendTo === 'inline' ? (mainContainer) : (React__namespace.createElement(Popper, { trigger: mainContainer, popper: popperContainer, direction: direction, appendTo: menuAppendTo === 'parent' ? getParentElement() : menuAppendTo, isVisible: isOpen }))))));
|
|
7602
7620
|
}
|
|
7603
7621
|
}
|
|
7604
7622
|
Select.displayName = 'Select';
|
|
@@ -7647,7 +7665,8 @@
|
|
|
7647
7665
|
chipGroupComponent: null,
|
|
7648
7666
|
isInputValuePersisted: false,
|
|
7649
7667
|
isInputFilterPersisted: false,
|
|
7650
|
-
isCreateSelectOptionObject: false
|
|
7668
|
+
isCreateSelectOptionObject: false,
|
|
7669
|
+
shouldResetOnSelect: true
|
|
7651
7670
|
};
|
|
7652
7671
|
|
|
7653
7672
|
const ArrowLeftIconConfig = {
|
|
@@ -14508,6 +14527,7 @@
|
|
|
14508
14527
|
"plain": "pf-m-plain",
|
|
14509
14528
|
"scrollable": "pf-m-scrollable",
|
|
14510
14529
|
"nav": "pf-m-nav",
|
|
14530
|
+
"focus": "pf-m-focus",
|
|
14511
14531
|
"disabled": "pf-m-disabled",
|
|
14512
14532
|
"load": "pf-m-load",
|
|
14513
14533
|
"loading": "pf-m-loading",
|
|
@@ -14689,8 +14709,27 @@
|
|
|
14689
14709
|
const menuContentRef = React__namespace.createRef();
|
|
14690
14710
|
const refCallback = (el, menuId, onGetMenuHeight) => {
|
|
14691
14711
|
if (el) {
|
|
14692
|
-
|
|
14693
|
-
|
|
14712
|
+
let clientHeight = el.clientHeight;
|
|
14713
|
+
// if this menu is a submenu, we need to account for the root menu list's padding and root menu content's border.
|
|
14714
|
+
let rootMenuList = null;
|
|
14715
|
+
let parentEl = el.closest(`.${_default$A.menuList}`);
|
|
14716
|
+
while (parentEl !== null && parentEl.nodeType === 1) {
|
|
14717
|
+
if (parentEl.classList.contains(_default$A.menuList)) {
|
|
14718
|
+
rootMenuList = parentEl;
|
|
14719
|
+
}
|
|
14720
|
+
parentEl = parentEl.parentElement;
|
|
14721
|
+
}
|
|
14722
|
+
if (rootMenuList) {
|
|
14723
|
+
const rootMenuListStyles = getComputedStyle(rootMenuList);
|
|
14724
|
+
const rootMenuListPaddingOffset = parseFloat(rootMenuListStyles.getPropertyValue('padding-top').replace(/px/g, '')) +
|
|
14725
|
+
parseFloat(rootMenuListStyles.getPropertyValue('padding-bottom').replace(/px/g, '')) +
|
|
14726
|
+
parseFloat(getComputedStyle(rootMenuList.parentElement)
|
|
14727
|
+
.getPropertyValue('border-bottom-width')
|
|
14728
|
+
.replace(/px/g, ''));
|
|
14729
|
+
clientHeight = clientHeight + rootMenuListPaddingOffset;
|
|
14730
|
+
}
|
|
14731
|
+
onGetMenuHeight && onGetMenuHeight(menuId, clientHeight);
|
|
14732
|
+
getHeight && getHeight(clientHeight.toString());
|
|
14694
14733
|
}
|
|
14695
14734
|
return ref || menuContentRef;
|
|
14696
14735
|
};
|
|
@@ -14992,10 +15031,13 @@
|
|
|
14992
15031
|
"text": "pf-m-text",
|
|
14993
15032
|
"disabled": "pf-m-disabled",
|
|
14994
15033
|
"fullHeight": "pf-m-full-height",
|
|
15034
|
+
"typeahead": "pf-m-typeahead",
|
|
14995
15035
|
"splitButton": "pf-m-split-button",
|
|
14996
15036
|
"action": "pf-m-action",
|
|
14997
|
-
"active": "pf-m-active"
|
|
14998
|
-
|
|
15037
|
+
"active": "pf-m-active",
|
|
15038
|
+
"fullWidth": "pf-m-full-width"
|
|
15039
|
+
},
|
|
15040
|
+
"textInputGroup": "pf-c-text-input-group"
|
|
14999
15041
|
};
|
|
15000
15042
|
|
|
15001
15043
|
class MenuToggleBase extends React__namespace.Component {
|
|
@@ -18502,13 +18544,13 @@
|
|
|
18502
18544
|
class TimePicker extends React__namespace.Component {
|
|
18503
18545
|
constructor(props) {
|
|
18504
18546
|
super(props);
|
|
18505
|
-
this.
|
|
18547
|
+
this.baseComponentRef = React__namespace.createRef();
|
|
18506
18548
|
this.toggleRef = React__namespace.createRef();
|
|
18507
18549
|
this.inputRef = React__namespace.createRef();
|
|
18508
18550
|
this.menuRef = React__namespace.createRef();
|
|
18509
18551
|
this.onDocClick = (event) => {
|
|
18510
18552
|
var _a, _b, _c, _d;
|
|
18511
|
-
const clickedOnToggle = (_b = (_a = this.
|
|
18553
|
+
const clickedOnToggle = (_b = (_a = this.toggleRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.contains(event.target);
|
|
18512
18554
|
const clickedWithinMenu = (_d = (_c = this.menuRef) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.contains(event.target);
|
|
18513
18555
|
if (this.state.isOpen && !(clickedOnToggle || clickedWithinMenu)) {
|
|
18514
18556
|
this.onToggle(false);
|
|
@@ -18698,7 +18740,7 @@
|
|
|
18698
18740
|
isInvalid: false
|
|
18699
18741
|
});
|
|
18700
18742
|
};
|
|
18701
|
-
this.
|
|
18743
|
+
this.onInputClick = (e) => {
|
|
18702
18744
|
if (!this.state.isOpen) {
|
|
18703
18745
|
this.onToggle(true);
|
|
18704
18746
|
}
|
|
@@ -18783,15 +18825,21 @@
|
|
|
18783
18825
|
const options = makeTimeOptions(stepMinutes, !is24Hour, delimiter, minTimeState, maxTimeState, includeSeconds);
|
|
18784
18826
|
const isValidFormat = this.isValidFormat(timeState);
|
|
18785
18827
|
const randomId = id || getUniqueId('time-picker');
|
|
18828
|
+
const getParentElement = () => {
|
|
18829
|
+
if (this.baseComponentRef && this.baseComponentRef.current) {
|
|
18830
|
+
return this.baseComponentRef.current.parentElement;
|
|
18831
|
+
}
|
|
18832
|
+
return null;
|
|
18833
|
+
};
|
|
18786
18834
|
const menuContainer = (React__namespace.createElement(Menu, { ref: this.menuRef, isScrollable: true },
|
|
18787
18835
|
React__namespace.createElement(MenuContent, { maxMenuHeight: "200px" },
|
|
18788
|
-
React__namespace.createElement(MenuList, { "aria-
|
|
18789
|
-
const textInput = (React__namespace.createElement(TextInput, Object.assign({ className: css(_default$1c.formControl), id: `${randomId}-input`, "aria-label": ariaLabel, validated: isInvalid ? 'error' : 'default', placeholder: placeholder, value: timeState || '', type: "text", iconVariant: "clock", onClick: this.
|
|
18790
|
-
return (React__namespace.createElement("div", { className: css(_default$R.datePicker, className) },
|
|
18836
|
+
React__namespace.createElement(MenuList, { "aria-label": ariaLabel }, options.map((option, index) => (React__namespace.createElement(MenuItem, { onClick: this.onSelect, key: option, id: `${randomId}-option-${index}` }, option)))))));
|
|
18837
|
+
const textInput = (React__namespace.createElement(TextInput, Object.assign({ "aria-haspopup": "menu", className: css(_default$1c.formControl), id: `${randomId}-input`, "aria-label": ariaLabel, validated: isInvalid ? 'error' : 'default', placeholder: placeholder, value: timeState || '', type: "text", iconVariant: "clock", onClick: this.onInputClick, onChange: this.onInputChange, onBlur: this.onBlur, autoComplete: "off", isDisabled: isDisabled, ref: this.inputRef }, inputProps)));
|
|
18838
|
+
return (React__namespace.createElement("div", { ref: this.baseComponentRef, className: css(_default$R.datePicker, className) },
|
|
18791
18839
|
React__namespace.createElement("div", Object.assign({ className: css(_default$R.datePickerInput), style: style }, props),
|
|
18792
18840
|
React__namespace.createElement(InputGroup, null,
|
|
18793
|
-
React__namespace.createElement("div", { id: randomId
|
|
18794
|
-
React__namespace.createElement("div", { ref: this.toggleRef, style: { paddingLeft: '0' } }, menuAppendTo !== 'inline' ? (React__namespace.createElement(Popper, { appendTo:
|
|
18841
|
+
React__namespace.createElement("div", { id: randomId },
|
|
18842
|
+
React__namespace.createElement("div", { ref: this.toggleRef, style: { paddingLeft: '0' } }, menuAppendTo !== 'inline' ? (React__namespace.createElement(Popper, { appendTo: menuAppendTo === 'parent' ? getParentElement() : menuAppendTo, trigger: textInput, popper: menuContainer, isVisible: isOpen })) : (textInput)),
|
|
18795
18843
|
isOpen && menuAppendTo === 'inline' && menuContainer)),
|
|
18796
18844
|
isInvalid && (React__namespace.createElement("div", { className: css(_default$R.datePickerHelperText, _default$R.modifiers.error) }, !isValidFormat ? invalidFormatErrorMessage : invalidMinMaxErrorMessage)))));
|
|
18797
18845
|
}
|
|
@@ -18808,6 +18856,7 @@
|
|
|
18808
18856
|
delimiter: ':',
|
|
18809
18857
|
'aria-label': 'Time picker',
|
|
18810
18858
|
width: '150px',
|
|
18859
|
+
menuAppendTo: 'inline',
|
|
18811
18860
|
stepMinutes: 30,
|
|
18812
18861
|
inputProps: {},
|
|
18813
18862
|
minTime: '',
|
|
@@ -20381,6 +20430,7 @@
|
|
|
20381
20430
|
"chipGroupList": "pf-c-chip-group__list",
|
|
20382
20431
|
"modifiers": {
|
|
20383
20432
|
"disabled": "pf-m-disabled",
|
|
20433
|
+
"plain": "pf-m-plain",
|
|
20384
20434
|
"icon": "pf-m-icon",
|
|
20385
20435
|
"hint": "pf-m-hint"
|
|
20386
20436
|
},
|
|
@@ -150,6 +150,7 @@
|
|
|
150
150
|
right: 0;
|
|
151
151
|
bottom: 0;
|
|
152
152
|
left: 0;
|
|
153
|
+
pointer-events: none;
|
|
153
154
|
content: "";
|
|
154
155
|
border-bottom: var(--pf-c-accordion--m-bordered__expanded-content--m-expanded__expanded-content-body--last-child--after--BorderBottomWidth) solid var(--pf-c-accordion--m-bordered__expanded-content--m-expanded__expanded-content-body--last-child--after--BorderBottomColor);
|
|
155
156
|
}
|
|
@@ -11574,7 +11575,7 @@ ul.pf-c-list {
|
|
|
11574
11575
|
--pf-c-menu__list-item--Color: var(--pf-c-menu__list-item--hover--Color, inherit);
|
|
11575
11576
|
}
|
|
11576
11577
|
|
|
11577
|
-
.pf-c-menu__list-item:focus-within {
|
|
11578
|
+
.pf-c-menu__list-item:focus-within, .pf-c-menu__list-item.pf-m-focus {
|
|
11578
11579
|
--pf-c-menu__list-item--BackgroundColor: var(--pf-c-menu__list-item--focus-within--BackgroundColor);
|
|
11579
11580
|
--pf-c-menu__list-item--Color: var(--pf-c-menu__list-item--focus-within--Color, inherit);
|
|
11580
11581
|
}
|
|
@@ -11864,6 +11865,11 @@ label.pf-c-menu__item:where(:not([disabled], .pf-m-disabled)) {
|
|
|
11864
11865
|
--pf-c-menu-toggle--m-split-button--m-action--m-secondary--child--BorderLeftColor: var(--pf-global--primary-color--100);
|
|
11865
11866
|
--pf-c-menu-toggle__button__controls--MarginRight: var(--pf-global--spacer--sm);
|
|
11866
11867
|
--pf-c-menu-toggle__button__controls--MarginLeft: var(--pf-global--spacer--sm);
|
|
11868
|
+
--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginTop: calc(var(--pf-c-menu-toggle--PaddingTop) * -1);
|
|
11869
|
+
--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginRight: calc(var(--pf-c-menu-toggle--PaddingRight) * -1);
|
|
11870
|
+
--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginBottom: calc(var(--pf-c-menu-toggle--PaddingBottom) * -1);
|
|
11871
|
+
--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginLeft: calc(var(--pf-c-menu-toggle--PaddingLeft) * -1);
|
|
11872
|
+
--pf-c-menu-toggle--m-typeahead--c-text-input-group__utilities--c-button--PaddingRight: var(--pf-global--spacer--sm);
|
|
11867
11873
|
position: relative;
|
|
11868
11874
|
display: inline-flex;
|
|
11869
11875
|
align-items: center;
|
|
@@ -11872,6 +11878,7 @@ label.pf-c-menu__item:where(:not([disabled], .pf-m-disabled)) {
|
|
|
11872
11878
|
font-size: var(--pf-c-menu-toggle--FontSize);
|
|
11873
11879
|
line-height: var(--pf-c-menu-toggle--LineHeight);
|
|
11874
11880
|
color: var(--pf-c-menu-toggle--Color);
|
|
11881
|
+
cursor: pointer;
|
|
11875
11882
|
background-color: var(--pf-c-menu-toggle--BackgroundColor);
|
|
11876
11883
|
border: 0;
|
|
11877
11884
|
border-radius: var(--pf-c-menu-toggle--BorderRadius);
|
|
@@ -11970,7 +11977,7 @@ label.pf-c-menu__item:where(:not([disabled], .pf-m-disabled)) {
|
|
|
11970
11977
|
--pf-c-menu-toggle--m-plain--Color: var(--pf-c-menu-toggle--m-plain--hover--Color);
|
|
11971
11978
|
}
|
|
11972
11979
|
|
|
11973
|
-
.pf-c-menu-toggle:focus {
|
|
11980
|
+
.pf-c-menu-toggle:focus, .pf-c-menu-toggle:focus-within {
|
|
11974
11981
|
--pf-c-menu-toggle--BackgroundColor: var(--pf-c-menu-toggle--focus--BackgroundColor);
|
|
11975
11982
|
--pf-c-menu-toggle--after--BorderBottomWidth: var(--pf-c-menu-toggle--focus--after--BorderBottomWidth);
|
|
11976
11983
|
--pf-c-menu-toggle--after--BorderBottomColor: var(--pf-c-menu-toggle--focus--after--BorderBottomColor);
|
|
@@ -12017,6 +12024,12 @@ label.pf-c-menu__item:where(:not([disabled], .pf-m-disabled)) {
|
|
|
12017
12024
|
height: 100%;
|
|
12018
12025
|
}
|
|
12019
12026
|
|
|
12027
|
+
.pf-c-menu-toggle.pf-m-typeahead .pf-c-text-input-group {
|
|
12028
|
+
--pf-c-text-input-group__utilities--c-button--PaddingRight: var(--pf-c-menu-toggle--m-typeahead--c-text-input-group__utilities--c-button--PaddingRight);
|
|
12029
|
+
flex: 1;
|
|
12030
|
+
margin: var(--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginTop) var(--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginRight) var(--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginBottom) var(--pf-c-menu-toggle--m-typeahead--c-text-input-group--MarginLeft);
|
|
12031
|
+
}
|
|
12032
|
+
|
|
12020
12033
|
.pf-c-menu-toggle.pf-m-split-button {
|
|
12021
12034
|
--pf-c-menu-toggle__toggle-icon--MarginRight: 0;
|
|
12022
12035
|
padding: 0;
|
|
@@ -12138,6 +12151,14 @@ label.pf-c-menu__item:where(:not([disabled], .pf-m-disabled)) {
|
|
|
12138
12151
|
background-color: var(--pf-c-menu-toggle--m-split-button--child--disabled--BackgroundColor);
|
|
12139
12152
|
}
|
|
12140
12153
|
|
|
12154
|
+
.pf-c-menu-toggle.pf-m-typeahead, .pf-c-menu-toggle.pf-m-split-button {
|
|
12155
|
+
--pf-c-menu-toggle__toggle-icon--MarginRight: 0;
|
|
12156
|
+
}
|
|
12157
|
+
|
|
12158
|
+
.pf-c-menu-toggle.pf-m-full-width {
|
|
12159
|
+
width: 100%;
|
|
12160
|
+
}
|
|
12161
|
+
|
|
12141
12162
|
.pf-c-menu-toggle__button {
|
|
12142
12163
|
color: inherit;
|
|
12143
12164
|
border: 0;
|
|
@@ -22027,6 +22048,14 @@ svg.pf-c-spinner.pf-m-xl {
|
|
|
22027
22048
|
pointer-events: none;
|
|
22028
22049
|
}
|
|
22029
22050
|
|
|
22051
|
+
.pf-c-text-input-group.pf-m-plain {
|
|
22052
|
+
--pf-c-text-input-group--BackgroundColor: transparent;
|
|
22053
|
+
}
|
|
22054
|
+
|
|
22055
|
+
.pf-c-text-input-group.pf-m-plain .pf-c-text-input-group__text::before, .pf-c-text-input-group.pf-m-plain .pf-c-text-input-group__text::after {
|
|
22056
|
+
border: 0;
|
|
22057
|
+
}
|
|
22058
|
+
|
|
22030
22059
|
.pf-c-text-input-group__main {
|
|
22031
22060
|
display: flex;
|
|
22032
22061
|
flex: 1;
|