@patternfly/react-core 6.4.1-prerelease.8 → 6.4.1
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 +2 -44
- 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/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Content/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/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/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/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/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Tile/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/AnimationsProvider/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/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/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/styles/package.json +1 -1
- package/dist/esm/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/esm/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +4 -14
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +4 -2
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +0 -4
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js +3 -5
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +0 -4
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js +2 -2
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +0 -2
- package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Modal/ModalContent.d.ts +0 -2
- package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalContent.js +2 -2
- package/dist/esm/components/Modal/ModalContent.js.map +1 -1
- package/dist/esm/components/Progress/ProgressContainer.js +2 -2
- package/dist/esm/components/Progress/ProgressContainer.js.map +1 -1
- package/dist/esm/components/Radio/Radio.d.ts +0 -3
- package/dist/esm/components/Radio/Radio.d.ts.map +1 -1
- package/dist/esm/components/Radio/Radio.js +5 -15
- package/dist/esm/components/Radio/Radio.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavInternal.js +3 -3
- package/dist/esm/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.d.ts +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.js +1 -2
- package/dist/esm/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/components/Wizard/WizardStep.d.ts +1 -1
- package/dist/esm/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/components/Wizard/types.d.ts +2 -3
- package/dist/esm/components/Wizard/types.d.ts.map +1 -1
- package/dist/esm/components/Wizard/types.js +0 -1
- package/dist/esm/components/Wizard/types.js.map +1 -1
- package/dist/esm/helpers/FocusTrap/FocusTrap.d.ts +0 -2
- package/dist/esm/helpers/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/dist/esm/helpers/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/esm/helpers/resizeObserver.js +2 -2
- package/dist/esm/helpers/resizeObserver.js.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/js/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/js/components/Checkbox/Checkbox.js +4 -14
- package/dist/js/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +4 -2
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +0 -4
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js +3 -5
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +0 -4
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js +2 -2
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/js/components/Modal/Modal.d.ts +0 -2
- package/dist/js/components/Modal/Modal.d.ts.map +1 -1
- package/dist/js/components/Modal/Modal.js.map +1 -1
- package/dist/js/components/Modal/ModalContent.d.ts +0 -2
- package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalContent.js +2 -2
- package/dist/js/components/Modal/ModalContent.js.map +1 -1
- package/dist/js/components/Progress/ProgressContainer.js +2 -2
- package/dist/js/components/Progress/ProgressContainer.js.map +1 -1
- package/dist/js/components/Radio/Radio.d.ts +0 -3
- package/dist/js/components/Radio/Radio.d.ts.map +1 -1
- package/dist/js/components/Radio/Radio.js +5 -15
- package/dist/js/components/Radio/Radio.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavInternal.js +3 -3
- package/dist/js/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.d.ts +1 -1
- package/dist/js/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.js +1 -2
- package/dist/js/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/components/Wizard/WizardStep.d.ts +1 -1
- package/dist/js/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/components/Wizard/types.d.ts +2 -3
- package/dist/js/components/Wizard/types.d.ts.map +1 -1
- package/dist/js/components/Wizard/types.js +0 -1
- package/dist/js/components/Wizard/types.js.map +1 -1
- package/dist/js/helpers/FocusTrap/FocusTrap.d.ts +0 -2
- package/dist/js/helpers/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/dist/js/helpers/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/js/helpers/resizeObserver.js +1 -1
- package/dist/js/helpers/resizeObserver.js.map +1 -1
- package/dist/umd/assets/{output-CyRsIwqr.css → output-Bj1Aarly.css} +16495 -16495
- package/dist/umd/react-core.min.js +1 -1
- 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/Checkbox/Checkbox.tsx +2 -21
- package/src/components/Checkbox/__tests__/Checkbox.test.tsx +0 -34
- package/src/components/Drawer/DrawerPanelContent.tsx +3 -5
- package/src/components/Drawer/__tests__/DrawerPanelContent.test.tsx +0 -37
- package/src/components/ExpandableSection/ExpandableSection.tsx +0 -10
- package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +0 -8
- package/src/components/ExpandableSection/__tests__/ExpandableSection.test.tsx +0 -17
- package/src/components/ExpandableSection/__tests__/ExpandableSectionToggle.test.tsx +0 -17
- package/src/components/MenuToggle/examples/MenuToggle.md +96 -13
- package/src/components/Modal/Modal.tsx +0 -2
- package/src/components/Modal/ModalContent.tsx +0 -4
- package/src/components/Modal/__tests__/Modal.test.tsx +0 -9
- package/src/components/Modal/__tests__/ModalContent.test.tsx +1 -17
- package/src/components/Modal/examples/Modal.md +5 -14
- package/src/components/Modal/examples/ModalWithDropdown.tsx +7 -34
- package/src/components/Panel/examples/Panel.md +159 -10
- package/src/components/Progress/ProgressContainer.tsx +2 -2
- package/src/components/Progress/__tests__/Generated/__snapshots__/ProgressContainer.test.tsx.snap +1 -1
- package/src/components/Progress/__tests__/__snapshots__/Progress.test.tsx.snap +1 -1
- package/src/components/Radio/Radio.tsx +3 -21
- package/src/components/Radio/__tests__/Radio.test.tsx +0 -44
- package/src/components/Tabs/__tests__/Tabs.test.tsx +1 -109
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +2 -2
- package/src/components/Tabs/examples/Tabs.md +4 -38
- package/src/components/Tabs/examples/TabsSeparateContent.tsx +2 -3
- package/src/components/Wizard/WizardNavInternal.tsx +3 -3
- package/src/components/Wizard/WizardNavItem.tsx +2 -5
- package/src/components/Wizard/WizardStep.tsx +1 -1
- package/src/components/Wizard/__tests__/Wizard.test.tsx +39 -0
- package/src/components/Wizard/__tests__/WizardNavItem.test.tsx +0 -6
- package/src/components/Wizard/__tests__/WizardStep.test.tsx +0 -2
- package/src/components/Wizard/examples/WizardStepStatus.tsx +7 -28
- package/src/components/Wizard/types.tsx +2 -3
- package/src/demos/AlertGroup.md +1 -1
- package/src/demos/BackToTop.md +1 -1
- package/src/demos/{Button/examples/ButtonProgress.tsx → Button.md} +19 -1
- package/src/demos/CardView/CardView.md +1 -1
- package/src/demos/DataListDemo.md +4 -4
- package/src/demos/DescriptionList/DescriptionList.md +2 -2
- package/src/demos/Nav.md +9 -9
- package/src/demos/{PasswordGenerator/examples/PasswordGenerator.tsx → PasswordGenerator.md} +19 -3
- package/src/demos/PrimaryDetail.md +6 -6
- package/src/demos/RTL/RTL.md +1 -1
- package/src/demos/SearchInput/SearchInput.md +487 -2
- package/src/demos/Toolbar.md +1 -1
- package/src/demos/examples/BackToTop/BackToTopNameDemo.tsx +1 -1
- package/src/helpers/FocusTrap/FocusTrap.tsx +0 -2
- package/src/helpers/FocusTrap/__tests__/Generated/FocusTrap.test.tsx +3 -3
- package/src/helpers/OUIA/OUIA.md +10 -2
- package/src/helpers/resizeObserver.tsx +2 -2
- package/src/layouts/Bullseye/examples/Bullseye.md +5 -1
- package/src/layouts/Flex/examples/Flex.md +442 -42
- package/src/layouts/Level/examples/Level.md +15 -3
- package/src/layouts/Split/examples/Split.md +34 -4
- package/src/components/MenuToggle/examples/MenuToggleAvatarText.tsx +0 -15
- package/src/components/MenuToggle/examples/MenuToggleBadge.tsx +0 -9
- package/src/components/MenuToggle/examples/MenuToggleCollapsed.tsx +0 -3
- package/src/components/MenuToggle/examples/MenuToggleDisabled.tsx +0 -3
- package/src/components/MenuToggle/examples/MenuToggleExpanded.tsx +0 -3
- package/src/components/MenuToggle/examples/MenuToggleFullHeight.tsx +0 -9
- package/src/components/MenuToggle/examples/MenuToggleFullWidth.tsx +0 -7
- package/src/components/MenuToggle/examples/MenuTogglePlainIcon.tsx +0 -11
- package/src/components/MenuToggle/examples/MenuTogglePlainTextLabel.tsx +0 -16
- package/src/components/MenuToggle/examples/MenuToggleVariantStyles.tsx +0 -14
- package/src/components/Panel/examples/PanelBasic.tsx +0 -9
- package/src/components/Panel/examples/PanelBordered.tsx +0 -9
- package/src/components/Panel/examples/PanelFooterExample.tsx +0 -10
- package/src/components/Panel/examples/PanelHeaderExample.tsx +0 -11
- package/src/components/Panel/examples/PanelHeaderFooter.tsx +0 -12
- package/src/components/Panel/examples/PanelNoBody.tsx +0 -7
- package/src/components/Panel/examples/PanelRaised.tsx +0 -9
- package/src/components/Panel/examples/PanelScrollable.tsx +0 -35
- package/src/components/Panel/examples/PanelScrollableHeaderFooter.tsx +0 -38
- package/src/components/Panel/examples/PanelSecondaryVariant.tsx +0 -9
- package/src/demos/Button/Button.md +0 -19
- package/src/demos/PasswordGenerator/PasswordGenerator.md +0 -16
- package/src/demos/SearchInput/examples/SearchInputAdvancedComposable.tsx +0 -322
- package/src/demos/SearchInput/examples/SearchInputAutocomplete.tsx +0 -165
- package/src/helpers/FocusTrap/__tests__/FocusTrap.test.tsx +0 -17
- package/src/helpers/OUIA/examples/OuiaExample.tsx +0 -11
- package/src/layouts/Bullseye/examples/BullseyeBasic.tsx +0 -7
- package/src/layouts/Flex/examples/FlexAdjustingWidth.tsx +0 -18
- package/src/layouts/Flex/examples/FlexAlignAdjacentContent.tsx +0 -16
- package/src/layouts/Flex/examples/FlexAlignRightMultipleGroups.tsx +0 -18
- package/src/layouts/Flex/examples/FlexAlignRightSingleItem.tsx +0 -8
- package/src/layouts/Flex/examples/FlexAlignSelfBaseline.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAlignSelfCenter.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAlignSelfFlexEnd.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAlignSelfStretch.tsx +0 -15
- package/src/layouts/Flex/examples/FlexAligningRight.tsx +0 -11
- package/src/layouts/Flex/examples/FlexAlternative.tsx +0 -11
- package/src/layouts/Flex/examples/FlexBasic.tsx +0 -11
- package/src/layouts/Flex/examples/FlexCanGrow.tsx +0 -18
- package/src/layouts/Flex/examples/FlexColumnGap.tsx +0 -16
- package/src/layouts/Flex/examples/FlexColumnLayout.tsx +0 -9
- package/src/layouts/Flex/examples/FlexColumnWidths.tsx +0 -18
- package/src/layouts/Flex/examples/FlexControlTextWidth.tsx +0 -17
- package/src/layouts/Flex/examples/FlexDefaultLayout.tsx +0 -11
- package/src/layouts/Flex/examples/FlexFirstLastOrder.tsx +0 -13
- package/src/layouts/Flex/examples/FlexGap.tsx +0 -16
- package/src/layouts/Flex/examples/FlexIndividuallySpaced.tsx +0 -14
- package/src/layouts/Flex/examples/FlexInline.tsx +0 -11
- package/src/layouts/Flex/examples/FlexJustifyContentEnd.tsx +0 -10
- package/src/layouts/Flex/examples/FlexJustifyContentFlexStart.tsx +0 -9
- package/src/layouts/Flex/examples/FlexJustifyContentSpaceBetween.tsx +0 -9
- package/src/layouts/Flex/examples/FlexNestedItems.tsx +0 -15
- package/src/layouts/Flex/examples/FlexNesting.tsx +0 -15
- package/src/layouts/Flex/examples/FlexNestingInColumns.tsx +0 -15
- package/src/layouts/Flex/examples/FlexOrdering.tsx +0 -24
- package/src/layouts/Flex/examples/FlexResponsiveFirstLastOrder.tsx +0 -15
- package/src/layouts/Flex/examples/FlexResponsiveOrdering.tsx +0 -25
- package/src/layouts/Flex/examples/FlexRowGap.tsx +0 -16
- package/src/layouts/Flex/examples/FlexSpacingNone.tsx +0 -11
- package/src/layouts/Flex/examples/FlexSpacingXl.tsx +0 -11
- package/src/layouts/Flex/examples/FlexStackingElements.tsx +0 -18
- package/src/layouts/Flex/examples/FlexSwitchingColumnRow.tsx +0 -16
- package/src/layouts/Level/examples/LevelBasic.tsx +0 -9
- package/src/layouts/Level/examples/LevelWithGutters.tsx +0 -9
- package/src/layouts/Split/examples/SplitBasic.tsx +0 -9
- package/src/layouts/Split/examples/SplitWithGutter.tsx +0 -9
- package/src/layouts/Split/examples/SplitWrappable.tsx +0 -20
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Password generator
|
|
3
|
+
section: patterns
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import RedoIcon from '@patternfly/react-icons/dist/esm/icons/redo-icon';
|
|
8
|
+
import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon';
|
|
9
|
+
import EyeSlashIcon from '@patternfly/react-icons/dist/esm/icons/eye-slash-icon';
|
|
10
|
+
|
|
11
|
+
## Demos
|
|
12
|
+
|
|
13
|
+
### Provide a generated password
|
|
14
|
+
|
|
15
|
+
```ts
|
|
1
16
|
import { useEffect, useRef, useState } from 'react';
|
|
2
17
|
import {
|
|
3
18
|
InputGroup,
|
|
@@ -15,12 +30,12 @@ import RedoIcon from '@patternfly/react-icons/dist/esm/icons/redo-icon';
|
|
|
15
30
|
import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon';
|
|
16
31
|
import EyeSlashIcon from '@patternfly/react-icons/dist/esm/icons/eye-slash-icon';
|
|
17
32
|
|
|
18
|
-
|
|
33
|
+
const PasswordGenerator: React.FunctionComponent = () => {
|
|
19
34
|
const generatePassword = () => {
|
|
20
35
|
const length = 12;
|
|
21
36
|
const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@%()_-=+';
|
|
22
37
|
let retVal = '';
|
|
23
|
-
for (
|
|
38
|
+
for (var i = 0, n = charset.length; i < length; ++i) {
|
|
24
39
|
retVal += charset.charAt(Math.floor(Math.random() * n));
|
|
25
40
|
}
|
|
26
41
|
return retVal;
|
|
@@ -138,7 +153,7 @@ export const PasswordGenerator: React.FunctionComponent = () => {
|
|
|
138
153
|
actions={
|
|
139
154
|
<MenuItemAction
|
|
140
155
|
icon={<RedoIcon />}
|
|
141
|
-
onClick={(
|
|
156
|
+
onClick={(e) => {
|
|
142
157
|
setGeneratedPassword(generatePassword());
|
|
143
158
|
}}
|
|
144
159
|
actionId="redo"
|
|
@@ -166,3 +181,4 @@ export const PasswordGenerator: React.FunctionComponent = () => {
|
|
|
166
181
|
/>
|
|
167
182
|
);
|
|
168
183
|
};
|
|
184
|
+
```
|
|
@@ -31,32 +31,32 @@ import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/Dashboard
|
|
|
31
31
|
|
|
32
32
|
### Primary-detail full page
|
|
33
33
|
|
|
34
|
-
```
|
|
34
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailFullPage.tsx" isFullscreen
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### Primary-detail content padding
|
|
38
38
|
|
|
39
|
-
```
|
|
39
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailContentPadding.tsx" isFullscreen
|
|
40
40
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
### Primary-detail card view
|
|
44
44
|
|
|
45
|
-
```
|
|
45
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailCardView.tsx" isFullscreen
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
### Primary-detail simple list in card
|
|
49
49
|
|
|
50
|
-
```
|
|
50
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailSimpleListInCard.tsx" isFullscreen
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
### Primary-detail data list in card
|
|
54
54
|
|
|
55
|
-
```
|
|
55
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailDataListInCard.tsx" isFullscreen
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Primary-detail inline modifier
|
|
59
59
|
|
|
60
|
-
```
|
|
60
|
+
```js file="./examples/PrimaryDetail/PrimaryDetailInlineModifier.tsx" isFullscreen
|
|
61
61
|
|
|
62
62
|
```
|
package/src/demos/RTL/RTL.md
CHANGED
|
@@ -31,8 +31,172 @@ import { words } from './words.js';
|
|
|
31
31
|
This demo handles building the advanced search form using the composable Menu, and the `SearchInput`'s `hint` prop.
|
|
32
32
|
It also demonstrates wiring up the appropriate keyboard interactions, focus management, and general event handling.
|
|
33
33
|
|
|
34
|
-
```
|
|
34
|
+
```js
|
|
35
|
+
import { useEffect, useRef, useState } from 'react';
|
|
36
|
+
import { Menu, MenuContent, MenuItem, MenuList, Popper, SearchInput } from '@patternfly/react-core';
|
|
37
|
+
|
|
38
|
+
import { words } from './words.js';
|
|
39
|
+
|
|
40
|
+
SearchAutocomplete = () => {
|
|
41
|
+
const [value, setValue] = useState('');
|
|
42
|
+
const [hint, setHint] = useState('');
|
|
43
|
+
const [autocompleteOptions, setAutocompleteOptions] = useState([]);
|
|
44
|
+
|
|
45
|
+
const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false);
|
|
46
|
+
|
|
47
|
+
const searchInputRef = useRef(null);
|
|
48
|
+
const autocompleteRef = useRef(null);
|
|
49
|
+
|
|
50
|
+
const onClear = () => {
|
|
51
|
+
setValue('');
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const onChange = (_event, newValue) => {
|
|
55
|
+
if (
|
|
56
|
+
newValue !== '' &&
|
|
57
|
+
searchInputRef &&
|
|
58
|
+
searchInputRef.current &&
|
|
59
|
+
searchInputRef.current.contains(document.activeElement)
|
|
60
|
+
) {
|
|
61
|
+
setIsAutocompleteOpen(true);
|
|
62
|
+
|
|
63
|
+
// When the value of the search input changes, build a list of no more than 10 autocomplete options.
|
|
64
|
+
// Options which start with the search input value are listed first, followed by options which contain
|
|
65
|
+
// the search input value.
|
|
66
|
+
let options = words
|
|
67
|
+
.filter((option) => option.startsWith(newValue.toLowerCase()))
|
|
68
|
+
.map((option) => (
|
|
69
|
+
<MenuItem itemId={option} key={option}>
|
|
70
|
+
{option}
|
|
71
|
+
</MenuItem>
|
|
72
|
+
));
|
|
73
|
+
if (options.length > 10) {
|
|
74
|
+
options = options.slice(0, 10);
|
|
75
|
+
} else {
|
|
76
|
+
options = [
|
|
77
|
+
...options,
|
|
78
|
+
...words
|
|
79
|
+
.filter((option) => !option.startsWith(newValue.toLowerCase()) && option.includes(newValue.toLowerCase()))
|
|
80
|
+
.map((option) => (
|
|
81
|
+
<MenuItem itemId={option} key={option}>
|
|
82
|
+
{option}
|
|
83
|
+
</MenuItem>
|
|
84
|
+
))
|
|
85
|
+
].slice(0, 10);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// The hint is set whenever there is only one autocomplete option left.
|
|
89
|
+
setHint(options.length === 1 ? options[0].props.itemId : '');
|
|
90
|
+
// The menu is hidden if there are no options
|
|
91
|
+
setIsAutocompleteOpen(options.length > 0);
|
|
92
|
+
setAutocompleteOptions(options);
|
|
93
|
+
} else {
|
|
94
|
+
setIsAutocompleteOpen(false);
|
|
95
|
+
}
|
|
96
|
+
setValue(newValue);
|
|
97
|
+
};
|
|
35
98
|
|
|
99
|
+
// Whenever an autocomplete option is selected, set the search input value, close the menu, and put the browser
|
|
100
|
+
// focus back on the search input
|
|
101
|
+
const onSelect = (e, itemId) => {
|
|
102
|
+
e.stopPropagation();
|
|
103
|
+
setValue(itemId);
|
|
104
|
+
setIsAutocompleteOpen(false);
|
|
105
|
+
searchInputRef.current.focus();
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const handleMenuKeys = (event) => {
|
|
109
|
+
// If there is a hint while the browser focus is on the search input, tab or right arrow will 'accept' the hint value
|
|
110
|
+
// and set it as the search input value
|
|
111
|
+
if (hint && (event.key === 'Tab' || event.key === 'ArrowRight') && searchInputRef.current === event.target) {
|
|
112
|
+
setValue(hint);
|
|
113
|
+
setHint('');
|
|
114
|
+
setIsAutocompleteOpen(false);
|
|
115
|
+
if (event.key === 'ArrowRight') {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
}
|
|
118
|
+
// if the autocomplete is open and the browser focus is on the search input,
|
|
119
|
+
} else if (isAutocompleteOpen && searchInputRef.current && searchInputRef.current === event.target) {
|
|
120
|
+
// the escape key closes the autocomplete menu and keeps the focus on the search input.
|
|
121
|
+
if (event.key === 'Escape') {
|
|
122
|
+
setIsAutocompleteOpen(false);
|
|
123
|
+
searchInputRef.current.focus();
|
|
124
|
+
// the up and down arrow keys move browser focus into the autocomplete menu
|
|
125
|
+
} else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
126
|
+
const firstElement = autocompleteRef.current.querySelector('li > button:not(:disabled)');
|
|
127
|
+
firstElement && firstElement.focus();
|
|
128
|
+
event.preventDefault(); // by default, the up and down arrow keys scroll the window
|
|
129
|
+
// the tab, enter, and space keys will close the menu, and the tab key will move browser
|
|
130
|
+
// focus forward one element (by default)
|
|
131
|
+
} else if (event.key === 'Tab' || event.key === 'Enter' || event.key === ' ') {
|
|
132
|
+
setIsAutocompleteOpen(false);
|
|
133
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// If the autocomplete is open and the browser focus is in the autocomplete menu
|
|
138
|
+
// hitting tab will close the autocomplete and but browser focus back on the search input.
|
|
139
|
+
} else if (isAutocompleteOpen && autocompleteRef.current.contains(event.target) && event.key === 'Tab') {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
setIsAutocompleteOpen(false);
|
|
142
|
+
searchInputRef.current.focus();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// The autocomplete menu should close if the user clicks outside the menu.
|
|
147
|
+
const handleClickOutside = (event) => {
|
|
148
|
+
if (
|
|
149
|
+
isAutocompleteOpen &&
|
|
150
|
+
autocompleteRef &&
|
|
151
|
+
autocompleteRef.current &&
|
|
152
|
+
!autocompleteRef.current.contains(event.target)
|
|
153
|
+
) {
|
|
154
|
+
setIsAutocompleteOpen(false);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
window.addEventListener('keydown', handleMenuKeys);
|
|
160
|
+
window.addEventListener('click', handleClickOutside);
|
|
161
|
+
return () => {
|
|
162
|
+
window.removeEventListener('keydown', handleMenuKeys);
|
|
163
|
+
window.removeEventListener('click', handleClickOutside);
|
|
164
|
+
};
|
|
165
|
+
}, [isAutocompleteOpen, hint, searchInputRef.current]);
|
|
166
|
+
|
|
167
|
+
const searchInput = (
|
|
168
|
+
<SearchInput
|
|
169
|
+
value={value}
|
|
170
|
+
onChange={onChange}
|
|
171
|
+
onClear={onClear}
|
|
172
|
+
ref={searchInputRef}
|
|
173
|
+
hint={hint}
|
|
174
|
+
id="autocomplete-search"
|
|
175
|
+
aria-label='Search with autocomplete'
|
|
176
|
+
/>
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const autocomplete = (
|
|
180
|
+
<Menu ref={autocompleteRef} onSelect={onSelect}>
|
|
181
|
+
<MenuContent>
|
|
182
|
+
<MenuList>{autocompleteOptions}</MenuList>
|
|
183
|
+
</MenuContent>
|
|
184
|
+
</Menu>
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<Popper
|
|
189
|
+
trigger={searchInput}
|
|
190
|
+
triggerRef={searchInputRef}
|
|
191
|
+
popper={autocomplete}
|
|
192
|
+
popperRef={autocompleteRef}
|
|
193
|
+
isVisible={isAutocompleteOpen}
|
|
194
|
+
enableFlip={false}
|
|
195
|
+
// append the autocomplete menu to the search input in the DOM for the sake of the keyboard navigation experience
|
|
196
|
+
appendTo={() => document.querySelector('#autocomplete-search')}
|
|
197
|
+
/>
|
|
198
|
+
);
|
|
199
|
+
};
|
|
36
200
|
```
|
|
37
201
|
|
|
38
202
|
### Composable advanced search
|
|
@@ -43,6 +207,327 @@ keyboard interactions, focus management, and general event handling.
|
|
|
43
207
|
|
|
44
208
|
Note: This demo and its handling of 'date within' and a date picker is modeled after the gmail advanced search form.
|
|
45
209
|
|
|
46
|
-
```
|
|
210
|
+
```js
|
|
211
|
+
import { useEffect, useRef, useState } from 'react';
|
|
212
|
+
import {
|
|
213
|
+
ActionGroup,
|
|
214
|
+
Button,
|
|
215
|
+
DatePicker,
|
|
216
|
+
Form,
|
|
217
|
+
FormGroup,
|
|
218
|
+
Grid,
|
|
219
|
+
GridItem,
|
|
220
|
+
isValidDate,
|
|
221
|
+
Menu,
|
|
222
|
+
MenuContent,
|
|
223
|
+
MenuItem,
|
|
224
|
+
MenuList,
|
|
225
|
+
MenuToggle,
|
|
226
|
+
Panel,
|
|
227
|
+
PanelMain,
|
|
228
|
+
PanelMainBody,
|
|
229
|
+
Popper,
|
|
230
|
+
SearchInput,
|
|
231
|
+
TextInput,
|
|
232
|
+
yyyyMMddFormat
|
|
233
|
+
} from '@patternfly/react-core';
|
|
234
|
+
|
|
235
|
+
AdvancedComposableSearchInput = () => {
|
|
236
|
+
const [value, setValue] = useState('');
|
|
237
|
+
const [hasWords, setHasWords] = useState('');
|
|
238
|
+
const [dateWithin, setDateWithin] = useState('1 day');
|
|
239
|
+
const [date, setDate] = useState();
|
|
240
|
+
|
|
241
|
+
const [isAdvancedSearchOpen, setIsAdvancedSearchOpen] = useState(false);
|
|
242
|
+
const [isDateWithinOpen, setIsDateWithinOpen] = useState(false);
|
|
243
|
+
|
|
244
|
+
const isInitialMount = useRef(true);
|
|
245
|
+
const firstAttrRef = useRef(null);
|
|
246
|
+
const searchInputRef = useRef(null);
|
|
247
|
+
const advancedSearchPaneRef = useRef(null);
|
|
248
|
+
const dateWithinToggleRef = useRef(undefined);
|
|
249
|
+
const dateWithinMenuRef = useRef(undefined);
|
|
250
|
+
|
|
251
|
+
const onClear = () => {
|
|
252
|
+
setValue('');
|
|
253
|
+
setHasWords('');
|
|
254
|
+
setDateWithin('');
|
|
255
|
+
setDate('');
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const onChange = (_event, value) => {
|
|
259
|
+
if (value.length <= hasWords.length + 1) {
|
|
260
|
+
setValue(value);
|
|
261
|
+
setHasWords(value);
|
|
262
|
+
} else {
|
|
263
|
+
setValue(hasWords);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// After initial page load, whenever the advanced search menu is opened, the browser focus should be placed on the
|
|
268
|
+
// first advanced search form input. Whenever the advanced search menu is closed, the browser focus should
|
|
269
|
+
// be returned to the search input.
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
if (isInitialMount.current) {
|
|
272
|
+
isInitialMount.current = false;
|
|
273
|
+
} else {
|
|
274
|
+
if (isAdvancedSearchOpen && firstAttrRef && firstAttrRef.current) {
|
|
275
|
+
firstAttrRef.current.focus();
|
|
276
|
+
} else if (!isAdvancedSearchOpen && searchInputRef) {
|
|
277
|
+
searchInputRef.current.focus();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}, [isAdvancedSearchOpen]);
|
|
281
|
+
|
|
282
|
+
// If a menu is open and has browser focus, then the escape key closes them and puts the browser focus onto their
|
|
283
|
+
// respective toggle. The 'date within' menu also needs to close when the 'tab' key is hit. However, hitting tab while
|
|
284
|
+
// focus is in the advanced search form should move the focus to the next form input, not close the advanced search
|
|
285
|
+
// menu.
|
|
286
|
+
const handleMenuKeys = (event) => {
|
|
287
|
+
if (isDateWithinOpen && dateWithinMenuRef.current && dateWithinMenuRef.current.contains(event.target)) {
|
|
288
|
+
if (event.key === 'Escape' || event.key === 'Tab') {
|
|
289
|
+
setIsDateWithinOpen(!isDateWithinOpen);
|
|
290
|
+
dateWithinToggleRef.current.focus();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (isAdvancedSearchOpen && advancedSearchPaneRef.current && advancedSearchPaneRef.current.contains(event.target)) {
|
|
294
|
+
if (
|
|
295
|
+
event.key === 'Escape' ||
|
|
296
|
+
(event.key === 'Tab' &&
|
|
297
|
+
!event.shiftKey &&
|
|
298
|
+
advancedSearchPaneRef.current.querySelector('button[type=reset]') === event.target)
|
|
299
|
+
) {
|
|
300
|
+
setIsAdvancedSearchOpen(!isAdvancedSearchOpen);
|
|
301
|
+
searchInputRef.current.focus();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
// If a menu is open and has browser focus, then clicking outside the menu should close it.
|
|
307
|
+
const handleClickOutside = (event) => {
|
|
308
|
+
if (
|
|
309
|
+
isDateWithinOpen &&
|
|
310
|
+
dateWithinMenuRef &&
|
|
311
|
+
dateWithinMenuRef.current &&
|
|
312
|
+
!dateWithinMenuRef.current.contains(event.target)
|
|
313
|
+
) {
|
|
314
|
+
setIsDateWithinOpen(false);
|
|
315
|
+
}
|
|
316
|
+
if (
|
|
317
|
+
isAdvancedSearchOpen &&
|
|
318
|
+
advancedSearchPaneRef &&
|
|
319
|
+
advancedSearchPaneRef.current &&
|
|
320
|
+
!advancedSearchPaneRef.current.contains(event.target)
|
|
321
|
+
) {
|
|
322
|
+
setIsAdvancedSearchOpen(false);
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
useEffect(() => {
|
|
327
|
+
window.addEventListener('keydown', handleMenuKeys);
|
|
328
|
+
window.addEventListener('click', handleClickOutside);
|
|
329
|
+
return () => {
|
|
330
|
+
window.removeEventListener('keydown', handleMenuKeys);
|
|
331
|
+
window.removeEventListener('click', handleClickOutside);
|
|
332
|
+
};
|
|
333
|
+
}, [dateWithinMenuRef.current, advancedSearchPaneRef.current, isAdvancedSearchOpen, isDateWithinOpen]);
|
|
334
|
+
|
|
335
|
+
// This demo and its handling of 'date within' and a date picker is modeled after the gmail advanced search form.
|
|
336
|
+
const onSubmit = (event, value) => {
|
|
337
|
+
event.preventDefault();
|
|
338
|
+
|
|
339
|
+
if (isValidDate(new Date(date)) && dateWithin) {
|
|
340
|
+
let afterDate = new Date(date);
|
|
341
|
+
let toDate = new Date(date);
|
|
342
|
+
switch (dateWithin) {
|
|
343
|
+
case '1 day':
|
|
344
|
+
afterDate.setDate(afterDate.getDate());
|
|
345
|
+
toDate.setDate(toDate.getDate() + 2);
|
|
346
|
+
break;
|
|
347
|
+
case '3 days':
|
|
348
|
+
afterDate.setDate(afterDate.getDate() - 2);
|
|
349
|
+
toDate.setDate(toDate.getDate() + 4);
|
|
350
|
+
break;
|
|
351
|
+
case '1 week':
|
|
352
|
+
afterDate.setDate(afterDate.getDate() - 6);
|
|
353
|
+
toDate.setDate(toDate.getDate() + 8);
|
|
354
|
+
break;
|
|
355
|
+
case '2 weeks':
|
|
356
|
+
afterDate.setDate(afterDate.getDate() - 13);
|
|
357
|
+
toDate.setDate(toDate.getDate() + 15);
|
|
358
|
+
break;
|
|
359
|
+
case '1 month':
|
|
360
|
+
afterDate.setMonth(afterDate.getMonth() - 1);
|
|
361
|
+
afterDate.setDate(afterDate.getDate() + 1);
|
|
362
|
+
toDate.setMonth(toDate.getMonth() + 1);
|
|
363
|
+
toDate.setDate(toDate.getDate() + 1);
|
|
364
|
+
break;
|
|
365
|
+
case '2 months':
|
|
366
|
+
afterDate.setMonth(afterDate.getMonth() - 2);
|
|
367
|
+
afterDate.setDate(afterDate.getDate() + 1);
|
|
368
|
+
toDate.setMonth(toDate.getMonth() + 2);
|
|
369
|
+
toDate.setDate(toDate.getDate() + 1);
|
|
370
|
+
break;
|
|
371
|
+
case '6 months':
|
|
372
|
+
afterDate.setMonth(afterDate.getMonth() - 6);
|
|
373
|
+
afterDate.setDate(afterDate.getDate() + 1);
|
|
374
|
+
toDate.setMonth(toDate.getMonth() + 6);
|
|
375
|
+
toDate.setDate(toDate.getDate() + 1);
|
|
376
|
+
break;
|
|
377
|
+
case '1 year':
|
|
378
|
+
afterDate.setFullYear(afterDate.getFullYear() - 1);
|
|
379
|
+
afterDate.setDate(afterDate.getDate() + 1);
|
|
380
|
+
toDate.setFullYear(toDate.getFullYear() + 1);
|
|
381
|
+
toDate.setDate(toDate.getDate() + 1);
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
setValue(`${hasWords && hasWords + ' '}after:${yyyyMMddFormat(afterDate)} to:${yyyyMMddFormat(toDate)}`);
|
|
385
|
+
} else {
|
|
386
|
+
setValue(hasWords);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
setIsAdvancedSearchOpen(false);
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
const searchInput = (
|
|
393
|
+
<SearchInput
|
|
394
|
+
value={value}
|
|
395
|
+
onChange={onChange}
|
|
396
|
+
onToggleAdvancedSearch={(e, isOpen) => {
|
|
397
|
+
e.stopPropagation();
|
|
398
|
+
setIsAdvancedSearchOpen(isOpen);
|
|
399
|
+
}}
|
|
400
|
+
isAdvancedSearchOpen={isAdvancedSearchOpen}
|
|
401
|
+
onClear={onClear}
|
|
402
|
+
onSearch={onSubmit}
|
|
403
|
+
ref={searchInputRef}
|
|
404
|
+
id="custom-advanced-search"
|
|
405
|
+
aria-label='Composable advanced search'
|
|
406
|
+
/>
|
|
407
|
+
);
|
|
408
|
+
|
|
409
|
+
// Clicking the 'date within' toggle should open its associated menu and then place the browser
|
|
410
|
+
// focus on the first menu item.
|
|
411
|
+
const toggleDateWithinMenu = (ev) => {
|
|
412
|
+
ev.stopPropagation(); // Stop handleClickOutside from handling
|
|
413
|
+
setTimeout(() => {
|
|
414
|
+
if (dateWithinMenuRef.current) {
|
|
415
|
+
const firstElement = dateWithinMenuRef.current.querySelector('li > button:not(:disabled)');
|
|
416
|
+
firstElement && firstElement.focus();
|
|
417
|
+
}
|
|
418
|
+
}, 0);
|
|
419
|
+
setIsDateWithinOpen(!isDateWithinOpen);
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
// Selecting a date within option closes the menu, sets the value of date within, and puts browser focus back
|
|
423
|
+
// on the date within toggle.
|
|
424
|
+
const onDateWithinSelect = (e, itemId) => {
|
|
425
|
+
e.stopPropagation();
|
|
426
|
+
setIsDateWithinOpen(false);
|
|
427
|
+
setDateWithin(itemId);
|
|
428
|
+
if (dateWithinToggleRef && dateWithinToggleRef.current) {
|
|
429
|
+
dateWithinToggleRef.current.focus();
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
const dateWithinOptions = (
|
|
434
|
+
<Menu ref={dateWithinMenuRef} selected={dateWithin} onSelect={onDateWithinSelect}>
|
|
435
|
+
<MenuContent>
|
|
436
|
+
<MenuList>
|
|
437
|
+
<MenuItem itemId="1 day">1 day</MenuItem>
|
|
438
|
+
<MenuItem itemId="3 days">3 days</MenuItem>
|
|
439
|
+
<MenuItem itemId="1 week">1 week</MenuItem>
|
|
440
|
+
<MenuItem itemId="2 weeks">2 weeks</MenuItem>
|
|
441
|
+
<MenuItem itemId="1 month">1 month</MenuItem>
|
|
442
|
+
<MenuItem itemId="2 months">2 months</MenuItem>
|
|
443
|
+
<MenuItem itemId="6 months">6 months</MenuItem>
|
|
444
|
+
<MenuItem itemId="1 year">1 year</MenuItem>
|
|
445
|
+
</MenuList>
|
|
446
|
+
</MenuContent>
|
|
447
|
+
</Menu>
|
|
448
|
+
);
|
|
449
|
+
|
|
450
|
+
const dateWithinToggle = (
|
|
451
|
+
<MenuToggle
|
|
452
|
+
ref={dateWithinToggleRef}
|
|
453
|
+
onClick={toggleDateWithinMenu}
|
|
454
|
+
isExpanded={isDateWithinOpen}
|
|
455
|
+
style={{ width: '100%' }}
|
|
456
|
+
>
|
|
457
|
+
{dateWithin}
|
|
458
|
+
</MenuToggle>
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
const advancedForm = (
|
|
462
|
+
<div ref={advancedSearchPaneRef} role="dialog" aria-label="Advanced search form">
|
|
463
|
+
<Panel variant="raised">
|
|
464
|
+
<PanelMain>
|
|
465
|
+
<PanelMainBody>
|
|
466
|
+
<Form>
|
|
467
|
+
<FormGroup label="Has the words" fieldId="has-words" key="has-words">
|
|
468
|
+
<TextInput
|
|
469
|
+
type="text"
|
|
470
|
+
id="has-words"
|
|
471
|
+
value={hasWords}
|
|
472
|
+
onChange={(_event, value) => {
|
|
473
|
+
setHasWords(value);
|
|
474
|
+
setValue(value);
|
|
475
|
+
}}
|
|
476
|
+
ref={firstAttrRef}
|
|
477
|
+
/>
|
|
478
|
+
</FormGroup>
|
|
479
|
+
<Grid hasGutter md={6}>
|
|
480
|
+
<GridItem>
|
|
481
|
+
<FormGroup label="Date within" fieldId="date-within" key="date-within">
|
|
482
|
+
<Popper
|
|
483
|
+
trigger={dateWithinToggle}
|
|
484
|
+
triggerRef={dateWithinToggleRef}
|
|
485
|
+
popper={dateWithinOptions}
|
|
486
|
+
popperRef={dateWithinMenuRef}
|
|
487
|
+
isVisible={isDateWithinOpen}
|
|
488
|
+
/>
|
|
489
|
+
</FormGroup>
|
|
490
|
+
</GridItem>
|
|
491
|
+
<GridItem>
|
|
492
|
+
<FormGroup label="Of date" fieldId="date" key="date">
|
|
493
|
+
<DatePicker
|
|
494
|
+
id="datePicker"
|
|
495
|
+
style={{ width: '100%' }}
|
|
496
|
+
value={date}
|
|
497
|
+
onChange={(_e, newValue) => setDate(newValue)}
|
|
498
|
+
appendTo={() => document.querySelector('#datePicker')}
|
|
499
|
+
/>
|
|
500
|
+
</FormGroup>
|
|
501
|
+
</GridItem>
|
|
502
|
+
</Grid>
|
|
503
|
+
<ActionGroup>
|
|
504
|
+
<Button variant="primary" type="submit" onClick={(e) => onSubmit(null, e)}>
|
|
505
|
+
Submit
|
|
506
|
+
</Button>
|
|
507
|
+
{!!onClear && (
|
|
508
|
+
<Button variant="link" type="reset" onClick={onClear}>
|
|
509
|
+
Reset
|
|
510
|
+
</Button>
|
|
511
|
+
)}
|
|
512
|
+
</ActionGroup>
|
|
513
|
+
</Form>
|
|
514
|
+
</PanelMainBody>
|
|
515
|
+
</PanelMain>
|
|
516
|
+
</Panel>
|
|
517
|
+
</div>
|
|
518
|
+
);
|
|
47
519
|
|
|
520
|
+
// Popper is just one way to build a relationship between a toggle and a menu.
|
|
521
|
+
return (
|
|
522
|
+
<Popper
|
|
523
|
+
trigger={searchInput}
|
|
524
|
+
triggerRef={searchInputRef}
|
|
525
|
+
popper={advancedForm}
|
|
526
|
+
popperRef={advancedSearchPaneRef}
|
|
527
|
+
isVisible={isAdvancedSearchOpen}
|
|
528
|
+
enableFlip={false}
|
|
529
|
+
appendTo={() => document.querySelector('#custom-advanced-search')}
|
|
530
|
+
/>
|
|
531
|
+
);
|
|
532
|
+
};
|
|
48
533
|
```
|
package/src/demos/Toolbar.md
CHANGED
|
@@ -20,5 +20,5 @@ import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/Dashboard
|
|
|
20
20
|
|
|
21
21
|
This is an example of toolbar usage in log viewer.
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```js file="./examples/Toolbar/ConsoleLogViewerToolbar.tsx" isFullscreen
|
|
24
24
|
```
|
|
@@ -2,7 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import { BackToTop, Card, CardBody, Content, Gallery, GalleryItem, PageSection, Switch } from '@patternfly/react-core';
|
|
3
3
|
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const Name = () => {
|
|
6
6
|
const [isAlwaysVisible, setIsAlwaysVisible] = useState(false);
|
|
7
7
|
|
|
8
8
|
const handleChange = (_event, isChecked) => {
|
|
@@ -8,8 +8,6 @@ export interface FocusTrapProps extends ComponentPropsWithRef<'div'> {
|
|
|
8
8
|
focusTrapOptions?: FocusTrapOptions;
|
|
9
9
|
/** Prevent from scrolling to the previously focused element on deactivation */
|
|
10
10
|
preventScrollOnDeactivate?: boolean;
|
|
11
|
-
/** Unique id that can optionally be applied to focus trap */
|
|
12
|
-
id?: string;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
export const FocusTrap = forwardRef<HTMLDivElement, FocusTrapProps>(function FocusTrap(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { render } from '@testing-library/react';
|
|
2
|
-
import { FocusTrap } from '../../FocusTrap';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* This test was generated
|
|
6
3
|
*/
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
|
+
import { FocusTrap } from '../../FocusTrap';
|
|
6
|
+
|
|
7
7
|
it('FocusTrap should match snapshot (auto-generated)', () => {
|
|
8
8
|
const { asFragment } = render(
|
|
9
9
|
<FocusTrap
|
package/src/helpers/OUIA/OUIA.md
CHANGED
|
@@ -40,8 +40,16 @@ component.
|
|
|
40
40
|
|
|
41
41
|
### Example
|
|
42
42
|
|
|
43
|
-
```
|
|
44
|
-
|
|
43
|
+
```js
|
|
44
|
+
import { Fragment } from 'react';
|
|
45
|
+
import { Button } from '@patternfly/react-core';
|
|
46
|
+
|
|
47
|
+
<Fragment>
|
|
48
|
+
<Button>Button</Button>
|
|
49
|
+
<br />
|
|
50
|
+
<br />
|
|
51
|
+
<Button ouiaId="static_id">Button with ouiaId</Button>
|
|
52
|
+
</Fragment>
|
|
45
53
|
```
|
|
46
54
|
|
|
47
55
|
## OUIA-compliant PatternFly 5 components
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { canUseDOM } from './util';
|
|
1
|
+
import { canUseDOM, debounce } from './util';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This function creates a ResizeObserver used to handle resize events for the given containerRef. If ResizeObserver
|
|
@@ -83,7 +83,7 @@ export const getResizeObserver = (
|
|
|
83
83
|
if (useRequestAnimationFrame) {
|
|
84
84
|
window.requestAnimationFrame(() => {
|
|
85
85
|
if (Array.isArray(entries) && entries.length > 0) {
|
|
86
|
-
handleResize
|
|
86
|
+
debounce(handleResize, 100);
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
// Avoid wrapping function in requestAnimationFrame if the function is debounced
|