@patternfly/react-core 4.254.0 → 4.255.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 +22 -0
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +10 -2
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/next/components/Dropdown/Dropdown.d.ts +6 -1
- package/dist/esm/next/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/next/components/Dropdown/Dropdown.js +4 -2
- package/dist/esm/next/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/next/components/Dropdown/DropdownItem.d.ts +6 -1
- package/dist/esm/next/components/Dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/esm/next/components/Dropdown/DropdownItem.js +4 -2
- package/dist/esm/next/components/Dropdown/DropdownItem.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +10 -2
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/next/components/Dropdown/Dropdown.d.ts +6 -1
- package/dist/js/next/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/next/components/Dropdown/Dropdown.js +4 -2
- package/dist/js/next/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/next/components/Dropdown/DropdownItem.d.ts +6 -1
- package/dist/js/next/components/Dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/js/next/components/Dropdown/DropdownItem.js +4 -2
- package/dist/js/next/components/Dropdown/DropdownItem.js.map +1 -1
- package/dist/umd/react-core.min.css +1062 -1062
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/DualListSelector/DualListSelector.tsx +10 -2
- package/src/next/components/Dropdown/Dropdown.tsx +10 -2
- package/src/next/components/Dropdown/DropdownItem.tsx +16 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.255.0",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^16.8 || ^17 || ^18",
|
|
71
71
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "d37ff721bbea043cbb5c51b95829f8143d37c80c"
|
|
74
74
|
}
|
|
@@ -279,7 +279,9 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
279
279
|
|
|
280
280
|
return {
|
|
281
281
|
chosenOptions: newChosen,
|
|
282
|
+
chosenFilteredOptions: newChosen,
|
|
282
283
|
availableOptions: newAvailable,
|
|
284
|
+
availableFilteredOptions: newAvailable,
|
|
283
285
|
chosenOptionsSelected: [],
|
|
284
286
|
availableOptionsSelected: []
|
|
285
287
|
};
|
|
@@ -339,7 +341,9 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
339
341
|
chosenOptionsSelected: [],
|
|
340
342
|
availableOptionsSelected: [],
|
|
341
343
|
chosenOptions: newChosen,
|
|
342
|
-
|
|
344
|
+
chosenFilteredOptions: newChosen,
|
|
345
|
+
availableOptions: newAvailable,
|
|
346
|
+
availableFilteredOptions: newAvailable
|
|
343
347
|
};
|
|
344
348
|
});
|
|
345
349
|
};
|
|
@@ -393,7 +397,9 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
393
397
|
|
|
394
398
|
return {
|
|
395
399
|
chosenOptions: newChosen,
|
|
400
|
+
chosenFilteredOptions: newChosen,
|
|
396
401
|
availableOptions: newAvailable,
|
|
402
|
+
availableFilteredOptions: newAvailable,
|
|
397
403
|
chosenOptionsSelected: [],
|
|
398
404
|
availableOptionsSelected: []
|
|
399
405
|
};
|
|
@@ -449,7 +455,9 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
449
455
|
chosenOptionsSelected: [],
|
|
450
456
|
availableOptionsSelected: [],
|
|
451
457
|
chosenOptions: newChosen,
|
|
452
|
-
|
|
458
|
+
chosenFilteredOptions: newChosen,
|
|
459
|
+
availableOptions: newAvailable,
|
|
460
|
+
availableFilteredOptions: newAvailable
|
|
453
461
|
};
|
|
454
462
|
});
|
|
455
463
|
};
|
|
@@ -2,8 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import { Menu, MenuContent, MenuProps } from '../../../components/Menu';
|
|
4
4
|
import { Popper } from '../../../helpers/Popper/Popper';
|
|
5
|
+
import { useOUIAProps, OUIAProps } from '../../../helpers';
|
|
5
6
|
|
|
6
|
-
export interface DropdownProps extends MenuProps {
|
|
7
|
+
export interface DropdownProps extends MenuProps, OUIAProps {
|
|
7
8
|
/** Anything which can be rendered in a dropdown. */
|
|
8
9
|
children?: React.ReactNode;
|
|
9
10
|
/** Classes applied to root element of dropdown. */
|
|
@@ -25,6 +26,10 @@ export interface DropdownProps extends MenuProps {
|
|
|
25
26
|
minWidth?: string;
|
|
26
27
|
/** @hide Forwarded ref */
|
|
27
28
|
innerRef?: React.Ref<any>;
|
|
29
|
+
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
30
|
+
ouiaId?: number | string;
|
|
31
|
+
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
32
|
+
ouiaSafe?: boolean;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
const DropdownBase: React.FunctionComponent<DropdownProps> = ({
|
|
@@ -38,11 +43,14 @@ const DropdownBase: React.FunctionComponent<DropdownProps> = ({
|
|
|
38
43
|
isScrollable,
|
|
39
44
|
minWidth,
|
|
40
45
|
innerRef,
|
|
46
|
+
ouiaId,
|
|
47
|
+
ouiaSafe = true,
|
|
41
48
|
...props
|
|
42
49
|
}: DropdownProps) => {
|
|
43
50
|
const localMenuRef = React.useRef<HTMLDivElement>();
|
|
44
51
|
const toggleRef = React.useRef<HTMLButtonElement>();
|
|
45
52
|
const containerRef = React.useRef<HTMLDivElement>();
|
|
53
|
+
const ouiaProps = useOUIAProps(Dropdown.displayName, ouiaId, ouiaSafe);
|
|
46
54
|
|
|
47
55
|
const menuRef = (innerRef as React.RefObject<HTMLDivElement>) || localMenuRef;
|
|
48
56
|
React.useEffect(() => {
|
|
@@ -104,7 +112,7 @@ const DropdownBase: React.FunctionComponent<DropdownProps> = ({
|
|
|
104
112
|
</Menu>
|
|
105
113
|
);
|
|
106
114
|
return (
|
|
107
|
-
<div ref={containerRef}>
|
|
115
|
+
<div ref={containerRef} {...ouiaProps}>
|
|
108
116
|
<Popper
|
|
109
117
|
trigger={toggle(toggleRef)}
|
|
110
118
|
removeFindDomNode
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import { MenuItemProps, MenuItem } from '../../../components/Menu';
|
|
4
|
+
import { useOUIAProps, OUIAProps } from '../../../helpers';
|
|
4
5
|
|
|
5
|
-
export interface DropdownItemProps extends Omit<MenuItemProps, 'ref'
|
|
6
|
+
export interface DropdownItemProps extends Omit<MenuItemProps, 'ref'>, OUIAProps {
|
|
6
7
|
/** Anything which can be rendered in a dropdown item */
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
/** Classes applied to root element of dropdown item */
|
|
9
10
|
className?: string;
|
|
10
11
|
/** Description of the dropdown item */
|
|
11
12
|
description?: React.ReactNode;
|
|
13
|
+
/** Value to overwrite the randomly generated data-ouia-component-id.*/
|
|
14
|
+
ouiaId?: number | string;
|
|
15
|
+
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
16
|
+
ouiaSafe?: boolean;
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
export const DropdownItem: React.FunctionComponent<MenuItemProps> = ({
|
|
15
20
|
children,
|
|
16
21
|
className,
|
|
17
22
|
description,
|
|
23
|
+
ouiaId,
|
|
24
|
+
ouiaSafe,
|
|
18
25
|
...props
|
|
19
|
-
}: DropdownItemProps) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
}: DropdownItemProps) => {
|
|
27
|
+
const ouiaProps = useOUIAProps(DropdownItem.displayName, ouiaId, ouiaSafe);
|
|
28
|
+
return (
|
|
29
|
+
<MenuItem className={css(className)} description={description} {...ouiaProps} {...props}>
|
|
30
|
+
{children}
|
|
31
|
+
</MenuItem>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
24
34
|
DropdownItem.displayName = 'DropdownItem';
|