@patternfly/react-core 5.1.1-prerelease.13 → 5.1.1-prerelease.14
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 +10 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/Chip/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/DragDrop/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/Text/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/Tile/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
- package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
- package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
- package/dist/dynamic/deprecated/components/Select/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/favorites/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/esm/components/Drawer/Drawer.d.ts +3 -3
- package/dist/esm/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/esm/components/Drawer/Drawer.js +3 -3
- package/dist/esm/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +77 -26
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalContent.js +3 -1
- package/dist/esm/components/Modal/ModalContent.js.map +1 -1
- package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/esm/components/Slider/SliderStep.js +2 -1
- package/dist/esm/components/Slider/SliderStep.js.map +1 -1
- package/dist/js/components/Drawer/Drawer.d.ts +3 -3
- package/dist/js/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/js/components/Drawer/Drawer.js +3 -3
- package/dist/js/components/Drawer/Drawer.js.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +77 -26
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalContent.js +3 -1
- package/dist/js/components/Modal/ModalContent.js.map +1 -1
- package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/js/components/Slider/SliderStep.js +2 -1
- package/dist/js/components/Slider/SliderStep.js.map +1 -1
- package/dist/umd/react-core.min.js +3 -3
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Drawer/Drawer.tsx +6 -6
- package/src/components/Drawer/DrawerPanelContent.tsx +72 -26
- package/src/components/Drawer/examples/Drawer.md +12 -12
- package/src/components/Drawer/examples/{DrawerInlinePanelRight.tsx → DrawerInlinePanelEnd.tsx} +1 -1
- package/src/components/Drawer/examples/{DrawerInlinePanelLeft.tsx → DrawerInlinePanelStart.tsx} +2 -2
- package/src/components/Drawer/examples/{DrawerPanelLeft.tsx → DrawerPanelEnd.tsx} +2 -2
- package/src/components/Drawer/examples/{DrawerPanelRight.tsx → DrawerPanelStart.tsx} +2 -2
- package/src/components/Drawer/examples/{DrawerResizableOnRight.tsx → DrawerResizableAtEnd.tsx} +3 -3
- package/src/components/Drawer/examples/{DrawerResizableOnLeft.tsx → DrawerResizableAtStart.tsx} +2 -2
- package/src/components/Modal/ModalContent.tsx +4 -6
- package/src/components/Slider/SliderStep.tsx +2 -1
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"5.1.1-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"5.1.1-prerelease.13","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"5.1.1-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"5.1.1-prerelease.13","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"5.1.1-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"5.1.1-prerelease.13","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.1.1-prerelease.
|
|
3
|
+
"version": "5.1.1-prerelease.14",
|
|
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": "^17 || ^18",
|
|
71
71
|
"react-dom": "^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "e27aac2f35e0a8bb16fa5397eb5ef841b3ecc578"
|
|
74
74
|
}
|
|
@@ -11,7 +11,7 @@ export enum DrawerColorVariant {
|
|
|
11
11
|
export interface DrawerProps extends React.HTMLProps<HTMLDivElement> {
|
|
12
12
|
/** Additional classes added to the Drawer. */
|
|
13
13
|
className?: string;
|
|
14
|
-
/** Content rendered in the
|
|
14
|
+
/** Content rendered in the drawer panel */
|
|
15
15
|
children?: React.ReactNode;
|
|
16
16
|
/** Indicates if the drawer is expanded */
|
|
17
17
|
isExpanded?: boolean;
|
|
@@ -19,8 +19,8 @@ export interface DrawerProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
19
19
|
isInline?: boolean;
|
|
20
20
|
/** Indicates if the drawer will always show both content and panel. */
|
|
21
21
|
isStatic?: boolean;
|
|
22
|
-
/** Position of the drawer panel */
|
|
23
|
-
position?: '
|
|
22
|
+
/** Position of the drawer panel. left and right are deprecated, use start and end instead. */
|
|
23
|
+
position?: 'start' | 'end' | 'bottom' | 'left' | 'right';
|
|
24
24
|
/** Callback when drawer panel is expanded after waiting 250ms for animation to complete. */
|
|
25
25
|
onExpand?: (event: KeyboardEvent | React.MouseEvent | React.TransitionEvent) => void;
|
|
26
26
|
}
|
|
@@ -39,7 +39,7 @@ export const DrawerContext = React.createContext<Partial<DrawerContextProps>>({
|
|
|
39
39
|
isExpanded: false,
|
|
40
40
|
isStatic: false,
|
|
41
41
|
onExpand: () => {},
|
|
42
|
-
position: '
|
|
42
|
+
position: 'end',
|
|
43
43
|
drawerRef: null,
|
|
44
44
|
drawerContentRef: null,
|
|
45
45
|
isInline: false
|
|
@@ -51,7 +51,7 @@ export const Drawer: React.FunctionComponent<DrawerProps> = ({
|
|
|
51
51
|
isExpanded = false,
|
|
52
52
|
isInline = false,
|
|
53
53
|
isStatic = false,
|
|
54
|
-
position = '
|
|
54
|
+
position = 'end',
|
|
55
55
|
onExpand = () => {},
|
|
56
56
|
...props
|
|
57
57
|
}: DrawerProps) => {
|
|
@@ -66,7 +66,7 @@ export const Drawer: React.FunctionComponent<DrawerProps> = ({
|
|
|
66
66
|
isExpanded && styles.modifiers.expanded,
|
|
67
67
|
isInline && styles.modifiers.inline,
|
|
68
68
|
isStatic && styles.modifiers.static,
|
|
69
|
-
position === 'left' && styles.modifiers.panelLeft,
|
|
69
|
+
(position === 'left' || position === 'start') && styles.modifiers.panelLeft,
|
|
70
70
|
position === 'bottom' && styles.modifiers.panelBottom,
|
|
71
71
|
className
|
|
72
72
|
)}
|
|
@@ -87,8 +87,8 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
87
87
|
const previouslyFocusedElement = React.useRef(null);
|
|
88
88
|
let currWidth: number = 0;
|
|
89
89
|
let panelRect: DOMRect;
|
|
90
|
-
let
|
|
91
|
-
let
|
|
90
|
+
let end: number;
|
|
91
|
+
let start: number;
|
|
92
92
|
let bottom: number;
|
|
93
93
|
let setInitialVals: boolean = true;
|
|
94
94
|
|
|
@@ -108,23 +108,52 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
108
108
|
const calcValueNow = () => {
|
|
109
109
|
let splitterPos;
|
|
110
110
|
let drawerSize;
|
|
111
|
+
const isRTL = window.getComputedStyle(panel.current).getPropertyValue('direction') === 'rtl';
|
|
111
112
|
|
|
112
|
-
if (isInline && position === 'right') {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
splitterRef.current.getBoundingClientRect().right -
|
|
126
|
-
|
|
127
|
-
|
|
113
|
+
if (isInline && (position === 'end' || position === 'right')) {
|
|
114
|
+
if (isRTL) {
|
|
115
|
+
splitterPos = panel.current.getBoundingClientRect().left - splitterRef.current.getBoundingClientRect().right;
|
|
116
|
+
drawerSize = drawerRef.current.getBoundingClientRect().left - drawerRef.current.getBoundingClientRect().right;
|
|
117
|
+
} else {
|
|
118
|
+
splitterPos = panel.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
|
|
119
|
+
drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
|
|
120
|
+
}
|
|
121
|
+
} else if (isInline && (position === 'start' || position === 'left')) {
|
|
122
|
+
if (isRTL) {
|
|
123
|
+
splitterPos = splitterRef.current.getBoundingClientRect().left - panel.current.getBoundingClientRect().right;
|
|
124
|
+
drawerSize = drawerRef.current.getBoundingClientRect().left - drawerRef.current.getBoundingClientRect().right;
|
|
125
|
+
} else {
|
|
126
|
+
splitterPos = splitterRef.current.getBoundingClientRect().right - panel.current.getBoundingClientRect().left;
|
|
127
|
+
drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
|
|
128
|
+
}
|
|
129
|
+
} else if (position === 'end' || position === 'right') {
|
|
130
|
+
if (isRTL) {
|
|
131
|
+
splitterPos =
|
|
132
|
+
drawerContentRef.current.getBoundingClientRect().left - splitterRef.current.getBoundingClientRect().right;
|
|
133
|
+
drawerSize =
|
|
134
|
+
drawerContentRef.current.getBoundingClientRect().left -
|
|
135
|
+
drawerContentRef.current.getBoundingClientRect().right;
|
|
136
|
+
} else {
|
|
137
|
+
splitterPos =
|
|
138
|
+
drawerContentRef.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
|
|
139
|
+
drawerSize =
|
|
140
|
+
drawerContentRef.current.getBoundingClientRect().right -
|
|
141
|
+
drawerContentRef.current.getBoundingClientRect().left;
|
|
142
|
+
}
|
|
143
|
+
} else if (position === 'start' || position === 'left') {
|
|
144
|
+
if (isRTL) {
|
|
145
|
+
splitterPos =
|
|
146
|
+
splitterRef.current.getBoundingClientRect().left - drawerContentRef.current.getBoundingClientRect().right;
|
|
147
|
+
drawerSize =
|
|
148
|
+
drawerContentRef.current.getBoundingClientRect().left -
|
|
149
|
+
drawerContentRef.current.getBoundingClientRect().right;
|
|
150
|
+
} else {
|
|
151
|
+
splitterPos =
|
|
152
|
+
splitterRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
|
|
153
|
+
drawerSize =
|
|
154
|
+
drawerContentRef.current.getBoundingClientRect().right -
|
|
155
|
+
drawerContentRef.current.getBoundingClientRect().left;
|
|
156
|
+
}
|
|
128
157
|
} else if (position === 'bottom') {
|
|
129
158
|
splitterPos =
|
|
130
159
|
drawerContentRef.current.getBoundingClientRect().bottom - splitterRef.current.getBoundingClientRect().top;
|
|
@@ -166,6 +195,8 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
166
195
|
};
|
|
167
196
|
|
|
168
197
|
const handleControlMove = (e: MouseEvent | TouchEvent, controlPosition: number) => {
|
|
198
|
+
const isRTL = window.getComputedStyle(panel.current).getPropertyValue('direction') === 'rtl';
|
|
199
|
+
|
|
169
200
|
e.stopPropagation();
|
|
170
201
|
if (!isResizing) {
|
|
171
202
|
return;
|
|
@@ -173,17 +204,22 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
173
204
|
|
|
174
205
|
if (setInitialVals) {
|
|
175
206
|
panelRect = panel.current.getBoundingClientRect();
|
|
176
|
-
|
|
177
|
-
|
|
207
|
+
if (isRTL) {
|
|
208
|
+
start = panelRect.right;
|
|
209
|
+
end = panelRect.left;
|
|
210
|
+
} else {
|
|
211
|
+
end = panelRect.right;
|
|
212
|
+
start = panelRect.left;
|
|
213
|
+
}
|
|
178
214
|
bottom = panelRect.bottom;
|
|
179
215
|
setInitialVals = false;
|
|
180
216
|
}
|
|
181
217
|
const mousePos = controlPosition;
|
|
182
218
|
let newSize = 0;
|
|
183
|
-
if (position === 'right') {
|
|
184
|
-
newSize =
|
|
185
|
-
} else if (position === 'left') {
|
|
186
|
-
newSize = mousePos -
|
|
219
|
+
if (position === 'end' || position === 'right') {
|
|
220
|
+
newSize = isRTL ? mousePos - end : end - mousePos;
|
|
221
|
+
} else if (position === 'start' || position === 'left') {
|
|
222
|
+
newSize = isRTL ? start - mousePos : mousePos - start;
|
|
187
223
|
} else {
|
|
188
224
|
newSize = bottom - mousePos;
|
|
189
225
|
}
|
|
@@ -225,6 +261,8 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
225
261
|
const callbackMouseUp = React.useCallback(handleMouseup, []);
|
|
226
262
|
|
|
227
263
|
const handleKeys = (e: React.KeyboardEvent) => {
|
|
264
|
+
const isRTL = window.getComputedStyle(panel.current).getPropertyValue('direction') === 'rtl';
|
|
265
|
+
|
|
228
266
|
const key = e.key;
|
|
229
267
|
if (
|
|
230
268
|
key !== 'Escape' &&
|
|
@@ -248,9 +286,17 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
|
|
|
248
286
|
newSize = position === 'bottom' ? panelRect.height : panelRect.width;
|
|
249
287
|
let delta = 0;
|
|
250
288
|
if (key === 'ArrowRight') {
|
|
251
|
-
|
|
289
|
+
if (isRTL) {
|
|
290
|
+
delta = position === 'left' || position === 'start' ? -increment : increment;
|
|
291
|
+
} else {
|
|
292
|
+
delta = position === 'left' || position === 'start' ? increment : -increment;
|
|
293
|
+
}
|
|
252
294
|
} else if (key === 'ArrowLeft') {
|
|
253
|
-
|
|
295
|
+
if (isRTL) {
|
|
296
|
+
delta = position === 'left' || position === 'start' ? increment : -increment;
|
|
297
|
+
} else {
|
|
298
|
+
delta = position === 'left' || position === 'start' ? -increment : increment;
|
|
299
|
+
}
|
|
254
300
|
} else if (key === 'ArrowUp') {
|
|
255
301
|
delta = increment;
|
|
256
302
|
} else if (key === 'ArrowDown') {
|
|
@@ -26,15 +26,15 @@ section: components
|
|
|
26
26
|
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
### Panel
|
|
29
|
+
### Panel at end
|
|
30
30
|
|
|
31
|
-
```ts file="./
|
|
31
|
+
```ts file="./DrawerPanelEnd.tsx"
|
|
32
32
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
### Panel
|
|
35
|
+
### Panel at start
|
|
36
36
|
|
|
37
|
-
```ts file="./
|
|
37
|
+
```ts file="./DrawerPanelStart.tsx"
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -50,15 +50,15 @@ section: components
|
|
|
50
50
|
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
### Inline panel
|
|
53
|
+
### Inline panel at end
|
|
54
54
|
|
|
55
|
-
```ts file="./
|
|
55
|
+
```ts file="./DrawerInlinePanelEnd.tsx"
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
### Inline panel
|
|
59
|
+
### Inline panel at start
|
|
60
60
|
|
|
61
|
-
```ts file="./
|
|
61
|
+
```ts file="./DrawerInlinePanelStart.tsx"
|
|
62
62
|
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -100,15 +100,15 @@ section: components
|
|
|
100
100
|
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
### Resizable
|
|
103
|
+
### Resizable at end
|
|
104
104
|
|
|
105
|
-
```ts file="
|
|
105
|
+
```ts file="DrawerResizableAtEnd.tsx"
|
|
106
106
|
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
### Resizable
|
|
109
|
+
### Resizable at start
|
|
110
110
|
|
|
111
|
-
```ts file="
|
|
111
|
+
```ts file="DrawerResizableAtStart.tsx"
|
|
112
112
|
|
|
113
113
|
```
|
|
114
114
|
|
package/src/components/Drawer/examples/{DrawerInlinePanelRight.tsx → DrawerInlinePanelEnd.tsx}
RENAMED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Button
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const DrawerInlinePanelEnd: React.FunctionComponent = () => {
|
|
14
14
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
15
|
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
16
|
|
package/src/components/Drawer/examples/{DrawerInlinePanelLeft.tsx → DrawerInlinePanelStart.tsx}
RENAMED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Button
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const DrawerInlinePanelStart: React.FunctionComponent = () => {
|
|
14
14
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
15
|
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
16
|
|
|
@@ -47,7 +47,7 @@ export const DrawerInlinePanelLeft: React.FunctionComponent = () => {
|
|
|
47
47
|
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
48
|
Toggle drawer
|
|
49
49
|
</Button>
|
|
50
|
-
<Drawer isExpanded={isExpanded} isInline position="
|
|
50
|
+
<Drawer isExpanded={isExpanded} isInline position="start" onExpand={onExpand}>
|
|
51
51
|
<DrawerContent panelContent={panelContent}>
|
|
52
52
|
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
53
|
</DrawerContent>
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Button
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const DrawerPanelEnd: React.FunctionComponent = () => {
|
|
14
14
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
15
|
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
16
|
|
|
@@ -47,7 +47,7 @@ export const DrawerPanelLeft: React.FunctionComponent = () => {
|
|
|
47
47
|
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
48
|
Toggle drawer
|
|
49
49
|
</Button>
|
|
50
|
-
<Drawer isExpanded={isExpanded} position="
|
|
50
|
+
<Drawer isExpanded={isExpanded} position="end" onExpand={onExpand}>
|
|
51
51
|
<DrawerContent panelContent={panelContent}>
|
|
52
52
|
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
53
|
</DrawerContent>
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Button
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const DrawerPanelStart: React.FunctionComponent = () => {
|
|
14
14
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
15
|
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
16
|
|
|
@@ -47,7 +47,7 @@ export const DrawerPanelRight: React.FunctionComponent = () => {
|
|
|
47
47
|
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
48
|
Toggle drawer
|
|
49
49
|
</Button>
|
|
50
|
-
<Drawer isExpanded={isExpanded} position="
|
|
50
|
+
<Drawer isExpanded={isExpanded} position="start" onExpand={onExpand}>
|
|
51
51
|
<DrawerContent panelContent={panelContent}>
|
|
52
52
|
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
53
|
</DrawerContent>
|
package/src/components/Drawer/examples/{DrawerResizableOnRight.tsx → DrawerResizableAtEnd.tsx}
RENAMED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Button
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const DrawerResizableAtEnd: React.FunctionComponent = () => {
|
|
14
14
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
15
|
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
16
|
|
|
@@ -32,7 +32,7 @@ export const DrawerResizableOnRight: React.FunctionComponent = () => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const panelContent = (
|
|
35
|
-
<DrawerPanelContent isResizable onResize={onResize} id="
|
|
35
|
+
<DrawerPanelContent isResizable onResize={onResize} id="end-resize-panel" defaultSize={'500px'} minSize={'150px'}>
|
|
36
36
|
<DrawerHead>
|
|
37
37
|
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
38
38
|
drawer-panel
|
|
@@ -52,7 +52,7 @@ export const DrawerResizableOnRight: React.FunctionComponent = () => {
|
|
|
52
52
|
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
53
53
|
Toggle drawer
|
|
54
54
|
</Button>
|
|
55
|
-
<Drawer isExpanded={isExpanded} onExpand={onExpand} position="
|
|
55
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand} position="end">
|
|
56
56
|
<DrawerContent panelContent={panelContent}>
|
|
57
57
|
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
58
58
|
</DrawerContent>
|
package/src/components/Drawer/examples/{DrawerResizableOnLeft.tsx → DrawerResizableAtStart.tsx}
RENAMED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Button
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const DrawerResizableAtStart: React.FunctionComponent = () => {
|
|
14
14
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
15
|
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
16
|
|
|
@@ -47,7 +47,7 @@ export const DrawerResizableOnLeft: React.FunctionComponent = () => {
|
|
|
47
47
|
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
48
|
Toggle drawer
|
|
49
49
|
</Button>
|
|
50
|
-
<Drawer isExpanded={isExpanded} onExpand={onExpand} position="
|
|
50
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand} position="start">
|
|
51
51
|
<DrawerContent panelContent={panelContent}>
|
|
52
52
|
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
53
|
</DrawerContent>
|
|
@@ -148,15 +148,13 @@ export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
|
|
|
148
148
|
|
|
149
149
|
const defaultModalBodyAriaRole = bodyAriaLabel ? 'region' : undefined;
|
|
150
150
|
|
|
151
|
+
const hasNoDescription = !description && !ariaDescribedby;
|
|
152
|
+
const id = hasNoDescription ? descriptorId : undefined;
|
|
153
|
+
|
|
151
154
|
const modalBody = hasNoBodyWrapper ? (
|
|
152
155
|
children
|
|
153
156
|
) : (
|
|
154
|
-
<ModalBoxBody
|
|
155
|
-
aria-label={bodyAriaLabel}
|
|
156
|
-
role={bodyAriaRole || defaultModalBodyAriaRole}
|
|
157
|
-
{...props}
|
|
158
|
-
{...(!description && !ariaDescribedby && { id: descriptorId })}
|
|
159
|
-
>
|
|
157
|
+
<ModalBoxBody aria-label={bodyAriaLabel} role={bodyAriaRole || defaultModalBodyAriaRole} {...props} id={id}>
|
|
160
158
|
{children}
|
|
161
159
|
</ModalBoxBody>
|
|
162
160
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Slider/slider';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import sliderStepLeft from '@patternfly/react-tokens/dist/esm/c_slider__step_Left';
|
|
4
5
|
|
|
5
6
|
export interface SliderStepProps extends Omit<React.HTMLProps<HTMLDivElement>, 'label'> {
|
|
6
7
|
/** Additional classes added to the slider step. */
|
|
@@ -26,7 +27,7 @@ export const SliderStep: React.FunctionComponent<SliderStepProps> = ({
|
|
|
26
27
|
isActive = false,
|
|
27
28
|
...props
|
|
28
29
|
}: SliderStepProps) => {
|
|
29
|
-
const style = {
|
|
30
|
+
const style = { [sliderStepLeft.name]: `${value ? value : sliderStepLeft.value}%` } as React.CSSProperties;
|
|
30
31
|
return (
|
|
31
32
|
<div className={css(styles.sliderStep, isActive && styles.modifiers.active, className)} style={style} {...props}>
|
|
32
33
|
{!isTickHidden && <div className={css(styles.sliderStepTick)} />}
|