@patternfly/react-core 4.170.0 → 4.170.4
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 +38 -0
- package/dist/esm/components/JumpLinks/JumpLinks.d.ts.map +1 -1
- package/dist/esm/components/JumpLinks/JumpLinks.js +8 -0
- package/dist/esm/components/JumpLinks/JumpLinks.js.map +1 -1
- package/dist/esm/components/Menu/DrilldownMenu.js +1 -1
- package/dist/esm/components/Menu/DrilldownMenu.js.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts +3 -0
- package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroup.js +6 -2
- package/dist/esm/components/TextInputGroup/TextInputGroup.js.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +8 -2
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +7 -3
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/js/components/JumpLinks/JumpLinks.d.ts.map +1 -1
- package/dist/js/components/JumpLinks/JumpLinks.js +8 -0
- package/dist/js/components/JumpLinks/JumpLinks.js.map +1 -1
- package/dist/js/components/Menu/DrilldownMenu.js +1 -1
- package/dist/js/components/Menu/DrilldownMenu.js.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroup.d.ts +3 -0
- package/dist/js/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroup.js +7 -3
- package/dist/js/components/TextInputGroup/TextInputGroup.js.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +8 -2
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js +7 -3
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/umd/react-core.css +32 -21
- package/dist/umd/react-core.js +23 -6
- package/dist/umd/react-core.min.css +20 -9
- package/dist/umd/react-core.min.js +3 -3
- package/package.json +6 -6
- package/src/components/JumpLinks/JumpLinks.tsx +8 -0
- package/src/components/Menu/DrilldownMenu.tsx +1 -1
- package/src/components/TextInputGroup/TextInputGroup.tsx +12 -3
- package/src/components/TextInputGroup/TextInputGroupMain.tsx +51 -20
- package/src/components/TextInputGroup/__tests__/TextInputGroup.test.tsx +91 -3
- package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroup.test.tsx.snap +19 -16
- package/src/components/TextInputGroup/examples/TextInputGroup.md +13 -0
package/dist/umd/react-core.js
CHANGED
|
@@ -7592,6 +7592,7 @@
|
|
|
7592
7592
|
"selected": "pf-m-selected",
|
|
7593
7593
|
"hoverableRaised": "pf-m-hoverable-raised",
|
|
7594
7594
|
"selectableRaised": "pf-m-selectable-raised",
|
|
7595
|
+
"nonSelectableRaised": "pf-m-non-selectable-raised",
|
|
7595
7596
|
"selectedRaised": "pf-m-selected-raised",
|
|
7596
7597
|
"compact": "pf-m-compact",
|
|
7597
7598
|
"displayLg": "pf-m-display-lg",
|
|
@@ -13384,6 +13385,8 @@
|
|
|
13384
13385
|
const [scrollItems, setScrollItems] = React__namespace.useState(hasScrollSpy ? getScrollItems(children, []) : []);
|
|
13385
13386
|
const [activeIndex, setActiveIndex] = React__namespace.useState(activeIndexProp);
|
|
13386
13387
|
const [isExpanded, setIsExpanded] = React__namespace.useState(isExpandedProp);
|
|
13388
|
+
// Boolean to disable scroll listener from overriding active state of clicked jumplink
|
|
13389
|
+
const isLinkClicked = React__namespace.useRef(false);
|
|
13387
13390
|
// Allow expanding to be controlled for a niche use case
|
|
13388
13391
|
React__namespace.useEffect(() => setIsExpanded(isExpandedProp), [isExpandedProp]);
|
|
13389
13392
|
const navRef = React__namespace.useRef();
|
|
@@ -13392,6 +13395,10 @@
|
|
|
13392
13395
|
if (!canUseDOM || !hasScrollSpy || !(scrollableElement instanceof HTMLElement)) {
|
|
13393
13396
|
return;
|
|
13394
13397
|
}
|
|
13398
|
+
if (isLinkClicked.current) {
|
|
13399
|
+
isLinkClicked.current = false;
|
|
13400
|
+
return;
|
|
13401
|
+
}
|
|
13395
13402
|
const scrollPosition = Math.ceil(scrollableElement.scrollTop + offset);
|
|
13396
13403
|
window.requestAnimationFrame(() => {
|
|
13397
13404
|
let newScrollItems = scrollItems;
|
|
@@ -13435,6 +13442,7 @@
|
|
|
13435
13442
|
const scrollItem = scrollItems[itemIndex];
|
|
13436
13443
|
return React__namespace.cloneElement(child, {
|
|
13437
13444
|
onClick(ev) {
|
|
13445
|
+
isLinkClicked.current = true;
|
|
13438
13446
|
// Items might have rendered after this component. Do a quick refresh.
|
|
13439
13447
|
let newScrollItems;
|
|
13440
13448
|
if (!scrollItem) {
|
|
@@ -13464,6 +13472,7 @@
|
|
|
13464
13472
|
}
|
|
13465
13473
|
newScrollItem.focus();
|
|
13466
13474
|
ev.preventDefault();
|
|
13475
|
+
setActiveIndex(itemIndex);
|
|
13467
13476
|
}
|
|
13468
13477
|
if (onClickProp) {
|
|
13469
13478
|
onClickProp(ev);
|
|
@@ -14544,7 +14553,7 @@
|
|
|
14544
14553
|
return (
|
|
14545
14554
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
14546
14555
|
React__default["default"].createElement(MenuContext.Consumer, null, (_a) => {
|
|
14547
|
-
var { menuId, parentMenu, flyoutRef, setFlyoutRef } = _a, context = __rest$1(_a, ["menuId", "parentMenu", "flyoutRef", "setFlyoutRef"]);
|
|
14556
|
+
var { menuId, parentMenu, flyoutRef, setFlyoutRef, disableHover } = _a, context = __rest$1(_a, ["menuId", "parentMenu", "flyoutRef", "setFlyoutRef", "disableHover"]);
|
|
14548
14557
|
return (React__default["default"].createElement(Menu, Object.assign({ id: id, parentMenu: menuId, isMenuDrilledIn: isMenuDrilledIn, isRootMenu: false, ref: React__default["default"].createRef() }, context, props),
|
|
14549
14558
|
React__default["default"].createElement(MenuContent, { getHeight: getHeight },
|
|
14550
14559
|
React__default["default"].createElement(MenuList, null, children))));
|
|
@@ -19822,21 +19831,28 @@
|
|
|
19822
19831
|
"textInputGroupUtilities": "pf-c-text-input-group__utilities"
|
|
19823
19832
|
};
|
|
19824
19833
|
|
|
19834
|
+
const TextInputGroupContext = React__namespace.createContext({
|
|
19835
|
+
isDisabled: false
|
|
19836
|
+
});
|
|
19825
19837
|
const TextInputGroup = (_a) => {
|
|
19826
|
-
var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
|
|
19827
|
-
return (React__namespace.createElement(
|
|
19838
|
+
var { children, className, isDisabled } = _a, props = __rest$1(_a, ["children", "className", "isDisabled"]);
|
|
19839
|
+
return (React__namespace.createElement(TextInputGroupContext.Provider, { value: { isDisabled } },
|
|
19840
|
+
React__namespace.createElement("div", Object.assign({ className: css(_default$6.textInputGroup, isDisabled && _default$6.modifiers.disabled, className) }, props), children)));
|
|
19828
19841
|
};
|
|
19829
19842
|
TextInputGroup.displayName = 'TextInputGroup';
|
|
19830
19843
|
|
|
19831
19844
|
const TextInputGroupMain = (_a) => {
|
|
19832
|
-
var { children, className, icon, onChange, 'aria-label': ariaLabel, value: inputValue } = _a, props = __rest$1(_a, ["children", "className", "icon", "onChange", 'aria-label', "value"]);
|
|
19845
|
+
var { children, className, icon, type = 'text', onChange = () => undefined, onFocus, onBlur, 'aria-label': ariaLabel = 'Type to filter', value: inputValue } = _a, props = __rest$1(_a, ["children", "className", "icon", "type", "onChange", "onFocus", "onBlur", 'aria-label', "value"]);
|
|
19846
|
+
const { isDisabled } = React__namespace.useContext(TextInputGroupContext);
|
|
19847
|
+
const handleChange = (event) => {
|
|
19848
|
+
onChange(event.currentTarget.value, event);
|
|
19849
|
+
};
|
|
19833
19850
|
return (React__namespace.createElement("div", Object.assign({ className: css(_default$6.textInputGroupMain, icon && _default$6.modifiers.icon, className) }, props),
|
|
19834
19851
|
children,
|
|
19835
19852
|
React__namespace.createElement("span", { className: css(_default$6.textInputGroupText) },
|
|
19836
19853
|
icon && React__namespace.createElement("span", { className: css(_default$6.textInputGroupIcon) }, icon),
|
|
19837
|
-
React__namespace.createElement("input", { type:
|
|
19854
|
+
React__namespace.createElement("input", { type: type, className: css(_default$6.textInputGroupTextInput), "aria-label": ariaLabel, disabled: isDisabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, value: inputValue }))));
|
|
19838
19855
|
};
|
|
19839
|
-
TextInputGroupMain.defaultProps = { 'aria-label': 'Type to filter' };
|
|
19840
19856
|
TextInputGroupMain.displayName = 'TextInputGroupMain';
|
|
19841
19857
|
|
|
19842
19858
|
const TextInputGroupUtilities = (_a) => {
|
|
@@ -20997,6 +21013,7 @@
|
|
|
20997
21013
|
exports.TextInput = TextInput;
|
|
20998
21014
|
exports.TextInputBase = TextInputBase;
|
|
20999
21015
|
exports.TextInputGroup = TextInputGroup;
|
|
21016
|
+
exports.TextInputGroupContext = TextInputGroupContext;
|
|
21000
21017
|
exports.TextInputGroupMain = TextInputGroupMain;
|
|
21001
21018
|
exports.TextInputGroupUtilities = TextInputGroupUtilities;
|
|
21002
21019
|
exports.TextList = TextList;
|
|
@@ -2377,6 +2377,10 @@ button.pf-c-breadcrumb__link {
|
|
|
2377
2377
|
--pf-c-card--m-selectable-raised--m-selected-raised--before--Transition: transform .25s linear;
|
|
2378
2378
|
--pf-c-card--m-selectable-raised--m-selected-raised--before--TranslateY: calc(var(--pf-c-card--m-selectable-raised--m-selected-raised--TranslateY) * -1);
|
|
2379
2379
|
--pf-c-card--m-selectable-raised--m-selected-raised--before--ScaleY: 2;
|
|
2380
|
+
--pf-c-card--m-non-selectable-raised--BackgroundColor: var(--pf-global--BackgroundColor--light-200);
|
|
2381
|
+
--pf-c-card--m-non-selectable-raised--before--BackgroundColor: var(--pf-global--disabled-color--200);
|
|
2382
|
+
--pf-c-card--m-non-selectable-raised--before--ScaleY: 2;
|
|
2383
|
+
--pf-c-card--m-flat--m-non-selectable-raised--before--BorderColor: var(--pf-global--disabled-color--200);
|
|
2380
2384
|
--pf-c-card--m-compact__body--FontSize: var(--pf-global--FontSize--sm);
|
|
2381
2385
|
--pf-c-card--m-compact__footer--FontSize: var(--pf-global--FontSize--sm);
|
|
2382
2386
|
--pf-c-card--m-compact--first-child--PaddingTop: var(--pf-global--spacer--md);
|
|
@@ -2442,11 +2446,11 @@ button.pf-c-breadcrumb__link {
|
|
|
2442
2446
|
background-color: var(--pf-c-card--m-selectable--m-selected--before--BackgroundColor);
|
|
2443
2447
|
}
|
|
2444
2448
|
|
|
2445
|
-
.pf-c-card.pf-m-hoverable-raised, .pf-c-card.pf-m-selectable-raised {
|
|
2449
|
+
.pf-c-card.pf-m-hoverable-raised, .pf-c-card.pf-m-selectable-raised, .pf-c-card.pf-m-non-selectable-raised {
|
|
2446
2450
|
position: relative;
|
|
2447
2451
|
}
|
|
2448
2452
|
|
|
2449
|
-
.pf-c-card.pf-m-hoverable-raised::before, .pf-c-card.pf-m-selectable-raised::before {
|
|
2453
|
+
.pf-c-card.pf-m-hoverable-raised::before, .pf-c-card.pf-m-selectable-raised::before, .pf-c-card.pf-m-non-selectable-raised::before {
|
|
2450
2454
|
position: absolute;
|
|
2451
2455
|
right: var(--pf-c-card--m-selectable-raised--before--Right);
|
|
2452
2456
|
bottom: var(--pf-c-card--m-selectable-raised--before--Bottom);
|
|
@@ -2466,12 +2470,6 @@ button.pf-c-breadcrumb__link {
|
|
|
2466
2470
|
|
|
2467
2471
|
.pf-c-card.pf-m-selectable-raised {
|
|
2468
2472
|
cursor: pointer;
|
|
2469
|
-
/*
|
|
2470
|
-
&:active {
|
|
2471
|
-
--pf-c-card--BoxShadow: var(--pf-c-card--m-selectable-raised--active--BoxShadow);
|
|
2472
|
-
--pf-c-card--m-selectable-raised--before--BackgroundColor: var(--pf-c-card--m-selectable-raised--active--before--BackgroundColor);
|
|
2473
|
-
}
|
|
2474
|
-
*/
|
|
2475
2473
|
}
|
|
2476
2474
|
|
|
2477
2475
|
.pf-c-card.pf-m-selectable-raised:hover {
|
|
@@ -2484,7 +2482,12 @@ button.pf-c-breadcrumb__link {
|
|
|
2484
2482
|
--pf-c-card--m-selectable-raised--before--BackgroundColor: var(--pf-c-card--m-selectable-raised--focus--before--BackgroundColor);
|
|
2485
2483
|
}
|
|
2486
2484
|
|
|
2487
|
-
.pf-c-card.pf-m-selectable-raised
|
|
2485
|
+
.pf-c-card.pf-m-selectable-raised:active {
|
|
2486
|
+
--pf-c-card--BoxShadow: var(--pf-c-card--m-selectable-raised--active--BoxShadow);
|
|
2487
|
+
--pf-c-card--m-selectable-raised--before--BackgroundColor: var(--pf-c-card--m-selectable-raised--active--before--BackgroundColor);
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
.pf-c-card.pf-m-selectable-raised.pf-m-selected-raised {
|
|
2488
2491
|
--pf-c-card--m-selectable-raised--before--BackgroundColor: var(--pf-c-card--m-selectable-raised--m-selected-raised--before--BackgroundColor);
|
|
2489
2492
|
--pf-c-card--m-selectable-raised--before--Transition: var(--pf-c-card--m-selectable-raised--m-selected-raised--before--Transition);
|
|
2490
2493
|
--pf-c-card--m-selectable-raised--before--TranslateY: var(--pf-c-card--m-selectable-raised--m-selected-raised--before--TranslateY);
|
|
@@ -2494,6 +2497,14 @@ button.pf-c-breadcrumb__link {
|
|
|
2494
2497
|
transform: translateY(var(--pf-c-card--m-selectable-raised--m-selected-raised--TranslateY));
|
|
2495
2498
|
}
|
|
2496
2499
|
|
|
2500
|
+
.pf-c-card.pf-m-non-selectable-raised {
|
|
2501
|
+
--pf-c-card--BackgroundColor: var(--pf-c-card--m-non-selectable-raised--BackgroundColor);
|
|
2502
|
+
--pf-c-card--BoxShadow: none;
|
|
2503
|
+
--pf-c-card--m-flat--BorderColor: var(--pf-c-card--m-flat--m-non-selectable-raised--before--BorderColor);
|
|
2504
|
+
--pf-c-card--m-selectable-raised--before--BackgroundColor: var(--pf-c-card--m-non-selectable-raised--before--BackgroundColor);
|
|
2505
|
+
--pf-c-card--m-selectable-raised--before--ScaleY: var(--pf-c-card--m-non-selectable-raised--before--ScaleY);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2497
2508
|
.pf-c-card.pf-m-compact {
|
|
2498
2509
|
--pf-c-card__body--FontSize: var(--pf-c-card--m-compact__body--FontSize);
|
|
2499
2510
|
--pf-c-card__footer--FontSize: var(--pf-c-card--m-compact__footer--FontSize);
|