@patternfly/react-docs 7.6.0-prerelease.8 → 7.6.0-prerelease.9

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.
Files changed (163) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +21 -0
  3. package/package.json +12 -11
  4. package/patternfly-docs/generated/components/about-modal/react.js +0 -149
  5. package/patternfly-docs/generated/components/accordion/react.js +0 -262
  6. package/patternfly-docs/generated/components/action-list/react.js +0 -144
  7. package/patternfly-docs/generated/components/alert/react-demos.js +0 -56
  8. package/patternfly-docs/generated/components/alert/react.js +0 -1433
  9. package/patternfly-docs/generated/components/avatar/react.js +0 -166
  10. package/patternfly-docs/generated/components/back-to-top/react-demos.js +0 -60
  11. package/patternfly-docs/generated/components/back-to-top/react.js +0 -77
  12. package/patternfly-docs/generated/components/backdrop/react.js +0 -64
  13. package/patternfly-docs/generated/components/background-image/react.js +0 -62
  14. package/patternfly-docs/generated/components/badge/react.js +0 -97
  15. package/patternfly-docs/generated/components/banner/react-demos.js +0 -57
  16. package/patternfly-docs/generated/components/banner/react.js +0 -148
  17. package/patternfly-docs/generated/components/brand/react.js +0 -142
  18. package/patternfly-docs/generated/components/breadcrumb/react.js +0 -206
  19. package/patternfly-docs/generated/components/button/react-demos.js +0 -57
  20. package/patternfly-docs/generated/components/button/react.js +0 -826
  21. package/patternfly-docs/generated/components/card/react-demos.js +0 -201
  22. package/patternfly-docs/generated/components/card/react.js +0 -1015
  23. package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +0 -1350
  24. package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +0 -1334
  25. package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +0 -1282
  26. package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +0 -848
  27. package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +0 -192
  28. package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +0 -426
  29. package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +0 -804
  30. package/patternfly-docs/generated/components/charts/legends/-Victory.js +0 -3230
  31. package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +0 -1178
  32. package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +0 -525
  33. package/patternfly-docs/generated/components/charts/patterns/-Victory.js +0 -3382
  34. package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +0 -377
  35. package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +0 -2475
  36. package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +0 -538
  37. package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +0 -1551
  38. package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +0 -4115
  39. package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +0 -955
  40. package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +0 -1173
  41. package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +0 -1166
  42. package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +0 -413
  43. package/patternfly-docs/generated/components/chip/react-deprecated.js +0 -323
  44. package/patternfly-docs/generated/components/clipboard-copy/react.js +0 -373
  45. package/patternfly-docs/generated/components/code-block/react.js +0 -148
  46. package/patternfly-docs/generated/components/code-editor/react.js +0 -659
  47. package/patternfly-docs/generated/components/compass/react-demos.js +0 -147
  48. package/patternfly-docs/generated/components/compass/react.js +0 -440
  49. package/patternfly-docs/generated/components/content/react.js +0 -248
  50. package/patternfly-docs/generated/components/data-list/react-demos.js +0 -90
  51. package/patternfly-docs/generated/components/data-list/react.js +0 -709
  52. package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +0 -283
  53. package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +0 -64
  54. package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +0 -83
  55. package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +0 -395
  56. package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +0 -241
  57. package/patternfly-docs/generated/components/description-list/react-demos.js +0 -58
  58. package/patternfly-docs/generated/components/description-list/react.js +0 -743
  59. package/patternfly-docs/generated/components/divider/react.js +0 -126
  60. package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +0 -351
  61. package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +0 -184
  62. package/patternfly-docs/generated/components/drag-and-drop/react.js +0 -137
  63. package/patternfly-docs/generated/components/drawer/react.js +0 -598
  64. package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +0 -772
  65. package/patternfly-docs/generated/components/dual-list-selector/react.js +0 -594
  66. package/patternfly-docs/generated/components/empty-state/react.js +0 -199
  67. package/patternfly-docs/generated/components/expandable-section/react-demos.js +0 -65
  68. package/patternfly-docs/generated/components/expandable-section/react.js +0 -408
  69. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +0 -52
  70. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +0 -398
  71. package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +0 -749
  72. package/patternfly-docs/generated/components/forms/checkbox/react.js +0 -222
  73. package/patternfly-docs/generated/components/forms/form/react.js +0 -1106
  74. package/patternfly-docs/generated/components/forms/form-select/react.js +0 -208
  75. package/patternfly-docs/generated/components/forms/radio/react.js +0 -212
  76. package/patternfly-docs/generated/components/forms/text-area/react.js +0 -160
  77. package/patternfly-docs/generated/components/forms/text-input/react.js +0 -216
  78. package/patternfly-docs/generated/components/helper-text/react-demos.js +0 -180
  79. package/patternfly-docs/generated/components/helper-text/react.js +0 -164
  80. package/patternfly-docs/generated/components/hero/react.js +0 -88
  81. package/patternfly-docs/generated/components/hint/react.js +0 -169
  82. package/patternfly-docs/generated/components/icon/react.js +0 -215
  83. package/patternfly-docs/generated/components/input-group/react.js +0 -182
  84. package/patternfly-docs/generated/components/jump-links/react-demos.js +0 -154
  85. package/patternfly-docs/generated/components/jump-links/react.js +0 -212
  86. package/patternfly-docs/generated/components/label/react-demos.js +0 -57
  87. package/patternfly-docs/generated/components/label/react.js +0 -417
  88. package/patternfly-docs/generated/components/list/react.js +0 -175
  89. package/patternfly-docs/generated/components/login-page/react.js +0 -587
  90. package/patternfly-docs/generated/components/masthead/react-demos.js +0 -79
  91. package/patternfly-docs/generated/components/masthead/react.js +0 -291
  92. package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +0 -769
  93. package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +0 -665
  94. package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +0 -187
  95. package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +0 -163
  96. package/patternfly-docs/generated/components/menus/dropdown/react.js +0 -998
  97. package/patternfly-docs/generated/components/menus/menu/react.js +0 -1540
  98. package/patternfly-docs/generated/components/menus/menu-toggle/react.js +0 -747
  99. package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +0 -508
  100. package/patternfly-docs/generated/components/menus/select/react-templates.js +0 -257
  101. package/patternfly-docs/generated/components/menus/select/react.js +0 -998
  102. package/patternfly-docs/generated/components/modal/react-deprecated.js +0 -554
  103. package/patternfly-docs/generated/components/modal/react.js +0 -597
  104. package/patternfly-docs/generated/components/navigation/react-demos.js +0 -356
  105. package/patternfly-docs/generated/components/navigation/react.js +0 -409
  106. package/patternfly-docs/generated/components/notification-badge/react.js +0 -196
  107. package/patternfly-docs/generated/components/notification-drawer/react-demos.js +0 -107
  108. package/patternfly-docs/generated/components/notification-drawer/react.js +0 -394
  109. package/patternfly-docs/generated/components/number-input/react.js +0 -210
  110. package/patternfly-docs/generated/components/overflow-menu/react.js +0 -274
  111. package/patternfly-docs/generated/components/page/react-demos.js +0 -149
  112. package/patternfly-docs/generated/components/page/react.js +0 -1352
  113. package/patternfly-docs/generated/components/pagination/react.js +0 -492
  114. package/patternfly-docs/generated/components/panel/react.js +0 -236
  115. package/patternfly-docs/generated/components/popover/react.js +0 -390
  116. package/patternfly-docs/generated/components/progress/react-demos.js +0 -59
  117. package/patternfly-docs/generated/components/progress/react.js +0 -283
  118. package/patternfly-docs/generated/components/progress-stepper/react-demos.js +0 -45
  119. package/patternfly-docs/generated/components/progress-stepper/react.js +0 -219
  120. package/patternfly-docs/generated/components/search-input/react-demos.js +0 -113
  121. package/patternfly-docs/generated/components/search-input/react.js +0 -263
  122. package/patternfly-docs/generated/components/sidebar/react.js +0 -236
  123. package/patternfly-docs/generated/components/simple-list/react.js +0 -200
  124. package/patternfly-docs/generated/components/skeleton/react-demos.js +0 -44
  125. package/patternfly-docs/generated/components/skeleton/react.js +0 -122
  126. package/patternfly-docs/generated/components/skip-to-content/react.js +0 -73
  127. package/patternfly-docs/generated/components/slider/react.js +0 -309
  128. package/patternfly-docs/generated/components/spinner/react.js +0 -111
  129. package/patternfly-docs/generated/components/switch/react.js +0 -163
  130. package/patternfly-docs/generated/components/table/react-demos.js +0 -355
  131. package/patternfly-docs/generated/components/table/react-deprecated.js +0 -1350
  132. package/patternfly-docs/generated/components/table/react.js +0 -3241
  133. package/patternfly-docs/generated/components/tabs/react-demos.js +0 -108
  134. package/patternfly-docs/generated/components/tabs/react.js +0 -1359
  135. package/patternfly-docs/generated/components/text-input-group/react-demos.js +0 -152
  136. package/patternfly-docs/generated/components/text-input-group/react.js +0 -278
  137. package/patternfly-docs/generated/components/tile/react-deprecated.js +0 -242
  138. package/patternfly-docs/generated/components/timestamp/react.js +0 -283
  139. package/patternfly-docs/generated/components/title/react.js +0 -94
  140. package/patternfly-docs/generated/components/toggle-group/react.js +0 -299
  141. package/patternfly-docs/generated/components/toolbar/react-demos.js +0 -66
  142. package/patternfly-docs/generated/components/toolbar/react.js +0 -932
  143. package/patternfly-docs/generated/components/tooltip/react.js +0 -241
  144. package/patternfly-docs/generated/components/tree-view/react.js +0 -429
  145. package/patternfly-docs/generated/components/truncate/react.js +0 -211
  146. package/patternfly-docs/generated/components/wizard/react-demos.js +0 -87
  147. package/patternfly-docs/generated/components/wizard/react-deprecated.js +0 -788
  148. package/patternfly-docs/generated/components/wizard/react.js +0 -986
  149. package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +0 -285
  150. package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +0 -70
  151. package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +0 -506
  152. package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +0 -94
  153. package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +0 -272
  154. package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +0 -87
  155. package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +0 -124
  156. package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +0 -112
  157. package/patternfly-docs/generated/index.js +0 -1769
  158. package/patternfly-docs/generated/patterns/card-view/react-demos.js +0 -78
  159. package/patternfly-docs/generated/patterns/filters/react-demos.js +0 -141
  160. package/patternfly-docs/generated/patterns/password-generator/react-demos.js +0 -51
  161. package/patternfly-docs/generated/patterns/password-strength/react-demos.js +0 -61
  162. package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +0 -124
  163. package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +0 -81
@@ -1,113 +0,0 @@
1
- import React from 'react';
2
- import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
- import { useEffect, useRef, useState } from 'react';
4
- import {
5
- Button,
6
- Card,
7
- CardBody,
8
- CardFooter,
9
- DatePicker,
10
- Form,
11
- FormGroup,
12
- Grid,
13
- GridItem,
14
- Menu,
15
- MenuContent,
16
- MenuItem,
17
- MenuList,
18
- MenuToggle,
19
- Popper,
20
- SearchInput,
21
- TextInput
22
- } from '@patternfly/react-core';
23
- import { words } from '../../../../../react-core/src/demos/SearchInput/./words.js';
24
- const pageData = {
25
- "id": "Search input",
26
- "section": "components",
27
- "subsection": "",
28
- "deprecated": false,
29
- "template": false,
30
- "beta": false,
31
- "demo": false,
32
- "newImplementationLink": false,
33
- "source": "react-demos",
34
- "tabName": null,
35
- "slug": "/components/search-input/react-demos",
36
- "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/demos/SearchInput/SearchInput.md",
37
- "relPath": "packages/react-core/src/demos/SearchInput/SearchInput.md",
38
- "examples": [
39
- "Search with autocomplete",
40
- "Composable advanced search"
41
- ]
42
- };
43
- pageData.liveContext = {
44
- useEffect,
45
- useRef,
46
- useState,
47
- Button,
48
- Card,
49
- CardBody,
50
- CardFooter,
51
- DatePicker,
52
- Form,
53
- FormGroup,
54
- Grid,
55
- GridItem,
56
- Menu,
57
- MenuContent,
58
- MenuItem,
59
- MenuList,
60
- MenuToggle,
61
- Popper,
62
- SearchInput,
63
- TextInput,
64
- words
65
- };
66
- pageData.relativeImports = "import { words } from 'react-core/src/demos/SearchInput/./words.js';"
67
- pageData.examples = {
68
- 'Search with autocomplete': props =>
69
- <Example {...pageData} {...props} {...{"code":"import { useEffect, useRef, useState } from 'react';\nimport { Menu, MenuContent, MenuItem, MenuList, Popper, SearchInput } from '@patternfly/react-core';\n\nimport { words } from '../words';\n\nexport const SearchInputAutocomplete: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n const [hint, setHint] = useState('');\n const [autocompleteOptions, setAutocompleteOptions] = useState([]);\n\n const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false);\n\n const searchInputRef = useRef(null);\n const autocompleteRef = useRef(null);\n\n const onClear = () => {\n setValue('');\n };\n\n const onChange = (_event, newValue) => {\n if (\n newValue !== '' &&\n searchInputRef &&\n searchInputRef.current &&\n searchInputRef.current.contains(document.activeElement)\n ) {\n setIsAutocompleteOpen(true);\n\n // When the value of the search input changes, build a list of no more than 10 autocomplete options.\n // Options which start with the search input value are listed first, followed by options which contain\n // the search input value.\n let options = words\n .filter((option) => option.startsWith(newValue.toLowerCase()))\n .map((option) => (\n <MenuItem itemId={option} key={option}>\n {option}\n </MenuItem>\n ));\n if (options.length > 10) {\n options = options.slice(0, 10);\n } else {\n options = [\n ...options,\n ...words\n .filter((option) => !option.startsWith(newValue.toLowerCase()) && option.includes(newValue.toLowerCase()))\n .map((option) => (\n <MenuItem itemId={option} key={option}>\n {option}\n </MenuItem>\n ))\n ].slice(0, 10);\n }\n\n // The hint is set whenever there is only one autocomplete option left.\n setHint(options.length === 1 ? options[0].props.itemId : '');\n // The menu is hidden if there are no options\n setIsAutocompleteOpen(options.length > 0);\n setAutocompleteOptions(options);\n } else {\n setIsAutocompleteOpen(false);\n }\n setValue(newValue);\n };\n\n // Whenever an autocomplete option is selected, set the search input value, close the menu, and put the browser\n // focus back on the search input\n const onSelect = (e, itemId) => {\n e.stopPropagation();\n setValue(itemId);\n setIsAutocompleteOpen(false);\n searchInputRef.current.focus();\n };\n\n const handleMenuKeys = (event) => {\n // If there is a hint while the browser focus is on the search input, tab or right arrow will 'accept' the hint value\n // and set it as the search input value\n if (hint && (event.key === 'Tab' || event.key === 'ArrowRight') && searchInputRef.current === event.target) {\n setValue(hint);\n setHint('');\n setIsAutocompleteOpen(false);\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n }\n // if the autocomplete is open and the browser focus is on the search input,\n } else if (isAutocompleteOpen && searchInputRef.current && searchInputRef.current === event.target) {\n // the escape key closes the autocomplete menu and keeps the focus on the search input.\n if (event.key === 'Escape') {\n setIsAutocompleteOpen(false);\n searchInputRef.current.focus();\n // the up and down arrow keys move browser focus into the autocomplete menu\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n const firstElement = autocompleteRef.current.querySelector('li > button:not(:disabled)');\n firstElement && firstElement.focus();\n event.preventDefault(); // by default, the up and down arrow keys scroll the window\n // the tab, enter, and space keys will close the menu, and the tab key will move browser\n // focus forward one element (by default)\n } else if (event.key === 'Tab' || event.key === 'Enter' || event.key === ' ') {\n setIsAutocompleteOpen(false);\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n }\n }\n // If the autocomplete is open and the browser focus is in the autocomplete menu\n // hitting tab will close the autocomplete and but browser focus back on the search input.\n } else if (isAutocompleteOpen && autocompleteRef.current.contains(event.target) && event.key === 'Tab') {\n event.preventDefault();\n setIsAutocompleteOpen(false);\n searchInputRef.current.focus();\n }\n };\n\n // The autocomplete menu should close if the user clicks outside the menu.\n const handleClickOutside = (event) => {\n if (\n isAutocompleteOpen &&\n autocompleteRef &&\n autocompleteRef.current &&\n !autocompleteRef.current.contains(event.target)\n ) {\n setIsAutocompleteOpen(false);\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', handleMenuKeys);\n window.addEventListener('click', handleClickOutside);\n return () => {\n window.removeEventListener('keydown', handleMenuKeys);\n window.removeEventListener('click', handleClickOutside);\n };\n }, [isAutocompleteOpen, hint, searchInputRef.current]);\n\n const searchInput = (\n <SearchInput\n value={value}\n onChange={onChange}\n onClear={onClear}\n ref={searchInputRef}\n hint={hint}\n id=\"autocomplete-search\"\n aria-label=\"Search with autocomplete\"\n />\n );\n\n const autocomplete = (\n <Menu ref={autocompleteRef} onSelect={onSelect}>\n <MenuContent>\n <MenuList>{autocompleteOptions}</MenuList>\n </MenuContent>\n </Menu>\n );\n\n return (\n <Popper\n trigger={searchInput}\n triggerRef={searchInputRef}\n popper={autocomplete}\n popperRef={autocompleteRef}\n isVisible={isAutocompleteOpen}\n enableFlip={false}\n // append the autocomplete menu to the search input in the DOM for the sake of the keyboard navigation experience\n appendTo={() => document.querySelector('#autocomplete-search')}\n />\n );\n};\n","title":"Search with autocomplete","lang":"ts","className":""}}>
70
-
71
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
72
- {`This demo handles building the advanced search form using the composable Menu, and the `}
73
-
74
- <code {...{"className":"ws-code "}}>
75
- {`SearchInput`}
76
- </code>
77
- {`'s `}
78
-
79
- <code {...{"className":"ws-code "}}>
80
- {`hint`}
81
- </code>
82
- {` prop.
83
- It also demonstrates wiring up the appropriate keyboard interactions, focus management, and general event handling.`}
84
- </p>
85
- </Example>,
86
- 'Composable advanced search': props =>
87
- <Example {...pageData} {...props} {...{"code":"import { useEffect, useRef, useState } from 'react';\nimport {\n ActionGroup,\n Button,\n DatePicker,\n Form,\n FormGroup,\n Grid,\n GridItem,\n isValidDate,\n Menu,\n MenuContent,\n MenuItem,\n MenuList,\n MenuToggle,\n Panel,\n PanelMain,\n PanelMainBody,\n Popper,\n SearchInput,\n TextInput,\n yyyyMMddFormat\n} from '@patternfly/react-core';\n\nexport const SearchInputAdvancedComposable: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n const [hasWords, setHasWords] = useState('');\n const [dateWithin, setDateWithin] = useState('1 day');\n const [date, setDate] = useState();\n\n const [isAdvancedSearchOpen, setIsAdvancedSearchOpen] = useState(false);\n const [isDateWithinOpen, setIsDateWithinOpen] = useState(false);\n\n const isInitialMount = useRef(true);\n const firstAttrRef = useRef(null);\n const searchInputRef = useRef(null);\n const advancedSearchPaneRef = useRef(null);\n const dateWithinToggleRef = useRef(undefined);\n const dateWithinMenuRef = useRef(undefined);\n\n const onClear = () => {\n setValue('');\n setHasWords('');\n setDateWithin('');\n setDate('');\n };\n\n const onChange = (_event, value) => {\n if (value.length <= hasWords.length + 1) {\n setValue(value);\n setHasWords(value);\n } else {\n setValue(hasWords);\n }\n };\n\n // After initial page load, whenever the advanced search menu is opened, the browser focus should be placed on the\n // first advanced search form input. Whenever the advanced search menu is closed, the browser focus should\n // be returned to the search input.\n useEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n } else {\n if (isAdvancedSearchOpen && firstAttrRef && firstAttrRef.current) {\n firstAttrRef.current.focus();\n } else if (!isAdvancedSearchOpen && searchInputRef) {\n searchInputRef.current.focus();\n }\n }\n }, [isAdvancedSearchOpen]);\n\n // If a menu is open and has browser focus, then the escape key closes them and puts the browser focus onto their\n // respective toggle. The 'date within' menu also needs to close when the 'tab' key is hit. However, hitting tab while\n // focus is in the advanced search form should move the focus to the next form input, not close the advanced search\n // menu.\n const handleMenuKeys = (event) => {\n if (isDateWithinOpen && dateWithinMenuRef.current && dateWithinMenuRef.current.contains(event.target)) {\n if (event.key === 'Escape' || event.key === 'Tab') {\n setIsDateWithinOpen(!isDateWithinOpen);\n dateWithinToggleRef.current.focus();\n }\n }\n if (isAdvancedSearchOpen && advancedSearchPaneRef.current && advancedSearchPaneRef.current.contains(event.target)) {\n if (\n event.key === 'Escape' ||\n (event.key === 'Tab' &&\n !event.shiftKey &&\n advancedSearchPaneRef.current.querySelector('button[type=reset]') === event.target)\n ) {\n setIsAdvancedSearchOpen(!isAdvancedSearchOpen);\n searchInputRef.current.focus();\n }\n }\n };\n\n // If a menu is open and has browser focus, then clicking outside the menu should close it.\n const handleClickOutside = (event) => {\n if (\n isDateWithinOpen &&\n dateWithinMenuRef &&\n dateWithinMenuRef.current &&\n !dateWithinMenuRef.current.contains(event.target)\n ) {\n setIsDateWithinOpen(false);\n }\n if (\n isAdvancedSearchOpen &&\n advancedSearchPaneRef &&\n advancedSearchPaneRef.current &&\n !advancedSearchPaneRef.current.contains(event.target)\n ) {\n setIsAdvancedSearchOpen(false);\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', handleMenuKeys);\n window.addEventListener('click', handleClickOutside);\n return () => {\n window.removeEventListener('keydown', handleMenuKeys);\n window.removeEventListener('click', handleClickOutside);\n };\n }, [dateWithinMenuRef.current, advancedSearchPaneRef.current, isAdvancedSearchOpen, isDateWithinOpen]);\n\n // This demo and its handling of 'date within' and a date picker is modeled after the gmail advanced search form.\n const onSubmit = (event, _value) => {\n event.preventDefault();\n\n if (isValidDate(new Date(date)) && dateWithin) {\n const afterDate = new Date(date);\n const toDate = new Date(date);\n switch (dateWithin) {\n case '1 day':\n afterDate.setDate(afterDate.getDate());\n toDate.setDate(toDate.getDate() + 2);\n break;\n case '3 days':\n afterDate.setDate(afterDate.getDate() - 2);\n toDate.setDate(toDate.getDate() + 4);\n break;\n case '1 week':\n afterDate.setDate(afterDate.getDate() - 6);\n toDate.setDate(toDate.getDate() + 8);\n break;\n case '2 weeks':\n afterDate.setDate(afterDate.getDate() - 13);\n toDate.setDate(toDate.getDate() + 15);\n break;\n case '1 month':\n afterDate.setMonth(afterDate.getMonth() - 1);\n afterDate.setDate(afterDate.getDate() + 1);\n toDate.setMonth(toDate.getMonth() + 1);\n toDate.setDate(toDate.getDate() + 1);\n break;\n case '2 months':\n afterDate.setMonth(afterDate.getMonth() - 2);\n afterDate.setDate(afterDate.getDate() + 1);\n toDate.setMonth(toDate.getMonth() + 2);\n toDate.setDate(toDate.getDate() + 1);\n break;\n case '6 months':\n afterDate.setMonth(afterDate.getMonth() - 6);\n afterDate.setDate(afterDate.getDate() + 1);\n toDate.setMonth(toDate.getMonth() + 6);\n toDate.setDate(toDate.getDate() + 1);\n break;\n case '1 year':\n afterDate.setFullYear(afterDate.getFullYear() - 1);\n afterDate.setDate(afterDate.getDate() + 1);\n toDate.setFullYear(toDate.getFullYear() + 1);\n toDate.setDate(toDate.getDate() + 1);\n break;\n }\n setValue(`${hasWords && hasWords + ' '}after:${yyyyMMddFormat(afterDate)} to:${yyyyMMddFormat(toDate)}`);\n } else {\n setValue(hasWords);\n }\n\n setIsAdvancedSearchOpen(false);\n };\n\n const searchInput = (\n <SearchInput\n value={value}\n onChange={onChange}\n onToggleAdvancedSearch={(e, isOpen) => {\n e.stopPropagation();\n setIsAdvancedSearchOpen(isOpen);\n }}\n isAdvancedSearchOpen={isAdvancedSearchOpen}\n onClear={onClear}\n onSearch={onSubmit}\n ref={searchInputRef}\n id=\"custom-advanced-search\"\n aria-label=\"Composable advanced search\"\n />\n );\n\n // Clicking the 'date within' toggle should open its associated menu and then place the browser\n // focus on the first menu item.\n const toggleDateWithinMenu = (ev) => {\n ev.stopPropagation(); // Stop handleClickOutside from handling\n setTimeout(() => {\n if (dateWithinMenuRef.current) {\n const firstElement = dateWithinMenuRef.current.querySelector('li > button:not(:disabled)');\n firstElement && firstElement.focus();\n }\n }, 0);\n setIsDateWithinOpen(!isDateWithinOpen);\n };\n\n // Selecting a date within option closes the menu, sets the value of date within, and puts browser focus back\n // on the date within toggle.\n const onDateWithinSelect = (e, itemId) => {\n e.stopPropagation();\n setIsDateWithinOpen(false);\n setDateWithin(itemId);\n if (dateWithinToggleRef && dateWithinToggleRef.current) {\n dateWithinToggleRef.current.focus();\n }\n };\n\n const dateWithinOptions = (\n <Menu ref={dateWithinMenuRef} selected={dateWithin} onSelect={onDateWithinSelect}>\n <MenuContent>\n <MenuList>\n <MenuItem itemId=\"1 day\">1 day</MenuItem>\n <MenuItem itemId=\"3 days\">3 days</MenuItem>\n <MenuItem itemId=\"1 week\">1 week</MenuItem>\n <MenuItem itemId=\"2 weeks\">2 weeks</MenuItem>\n <MenuItem itemId=\"1 month\">1 month</MenuItem>\n <MenuItem itemId=\"2 months\">2 months</MenuItem>\n <MenuItem itemId=\"6 months\">6 months</MenuItem>\n <MenuItem itemId=\"1 year\">1 year</MenuItem>\n </MenuList>\n </MenuContent>\n </Menu>\n );\n\n const dateWithinToggle = (\n <MenuToggle\n ref={dateWithinToggleRef}\n onClick={toggleDateWithinMenu}\n isExpanded={isDateWithinOpen}\n style={{ width: '100%' }}\n >\n {dateWithin}\n </MenuToggle>\n );\n\n const advancedForm = (\n <div ref={advancedSearchPaneRef} role=\"dialog\" aria-label=\"Advanced search form\">\n <Panel variant=\"raised\">\n <PanelMain>\n <PanelMainBody>\n <Form>\n <FormGroup label=\"Has the words\" fieldId=\"has-words\" key=\"has-words\">\n <TextInput\n type=\"text\"\n id=\"has-words\"\n value={hasWords}\n onChange={(_event, value) => {\n setHasWords(value);\n setValue(value);\n }}\n ref={firstAttrRef}\n />\n </FormGroup>\n <Grid hasGutter md={6}>\n <GridItem>\n <FormGroup label=\"Date within\" fieldId=\"date-within\" key=\"date-within\">\n <Popper\n trigger={dateWithinToggle}\n triggerRef={dateWithinToggleRef}\n popper={dateWithinOptions}\n popperRef={dateWithinMenuRef}\n isVisible={isDateWithinOpen}\n />\n </FormGroup>\n </GridItem>\n <GridItem>\n <FormGroup label=\"Of date\" fieldId=\"date\" key=\"date\">\n <DatePicker\n id=\"datePicker\"\n style={{ width: '100%' }}\n value={date}\n onChange={(_e, newValue) => setDate(newValue)}\n appendTo={() => document.querySelector('#datePicker')}\n />\n </FormGroup>\n </GridItem>\n </Grid>\n <ActionGroup>\n <Button variant=\"primary\" type=\"submit\" onClick={(e) => onSubmit(null, e)}>\n Submit\n </Button>\n {!!onClear && (\n <Button variant=\"link\" type=\"reset\" onClick={onClear}>\n Reset\n </Button>\n )}\n </ActionGroup>\n </Form>\n </PanelMainBody>\n </PanelMain>\n </Panel>\n </div>\n );\n\n // Popper is just one way to build a relationship between a toggle and a menu.\n return (\n <Popper\n trigger={searchInput}\n triggerRef={searchInputRef}\n popper={advancedForm}\n popperRef={advancedSearchPaneRef}\n isVisible={isAdvancedSearchOpen}\n enableFlip={false}\n appendTo={() => document.querySelector('#custom-advanced-search')}\n />\n );\n};\n","title":"Composable advanced search","lang":"ts","className":""}}>
88
-
89
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
90
- {`This demo handles building the advanced search form using the composable Menu, as well as wiring up a
91
- select using the composable Menu and MenuToggle components. This demo also demonstrates wiring up the appropriate
92
- keyboard interactions, focus management, and general event handling.`}
93
- </p>
94
-
95
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
96
- {`Note: This demo and its handling of 'date within' and a date picker is modeled after the gmail advanced search form.`}
97
- </p>
98
- </Example>
99
- };
100
-
101
- const Component = () => (
102
- <React.Fragment>
103
- <AutoLinkHeader {...{"id":"demos","headingLevel":"h2","className":"ws-title ws-h2"}}>
104
- {`Demos`}
105
- </AutoLinkHeader>
106
- {React.createElement(pageData.examples["Search with autocomplete"])}
107
- {React.createElement(pageData.examples["Composable advanced search"])}
108
- </React.Fragment>
109
- );
110
- Component.displayName = 'ComponentsSearchInputReactDemosDocs';
111
- Component.pageData = pageData;
112
-
113
- export default Component;
@@ -1,263 +0,0 @@
1
- import React from 'react';
2
- import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
- import { useRef, useState } from 'react';
4
- import RhUiExternalLinkFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-external-link-fill-icon';
5
- const pageData = {
6
- "id": "Search input",
7
- "section": "components",
8
- "subsection": "",
9
- "deprecated": false,
10
- "template": false,
11
- "beta": false,
12
- "demo": false,
13
- "newImplementationLink": false,
14
- "source": "react",
15
- "tabName": null,
16
- "slug": "/components/search-input/react",
17
- "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/SearchInput/examples/SearchInput.md",
18
- "relPath": "packages/react-core/src/components/SearchInput/examples/SearchInput.md",
19
- "propComponents": [
20
- {
21
- "name": "SearchInput",
22
- "description": "",
23
- "props": [
24
- {
25
- "name": "advancedSearchDelimiter",
26
- "type": "string",
27
- "description": "Delimiter in the query string for pairing attributes with search values.\nRequired whenever attributes are passed as props."
28
- },
29
- {
30
- "name": "attributes",
31
- "type": "string[] | SearchInputSearchAttribute[]",
32
- "description": "Array of attribute values used for dynamically generated advanced search.",
33
- "defaultValue": "[]"
34
- },
35
- {
36
- "name": "className",
37
- "type": "string",
38
- "description": "Additional classes added to the advanced search menu."
39
- },
40
- {
41
- "name": "formAdditionalItems",
42
- "type": "React.ReactNode",
43
- "description": ""
44
- },
45
- {
46
- "name": "getAttrValueMap",
47
- "type": "() => { [key: string]: string }",
48
- "description": "Function which builds an attribute-value map by parsing the value in the search input."
49
- },
50
- {
51
- "name": "hasWordsAttrLabel",
52
- "type": "React.ReactNode",
53
- "description": "Attribute label for strings unassociated with one of the provided listed attributes.",
54
- "defaultValue": "'Has words'"
55
- },
56
- {
57
- "name": "isSearchMenuOpen",
58
- "type": "boolean",
59
- "description": "Flag for toggling the open/close state of the advanced search menu."
60
- },
61
- {
62
- "name": "onChange",
63
- "type": "(event: React.FormEvent<HTMLInputElement>, value: string) => void",
64
- "description": "A callback for when the input value changes."
65
- },
66
- {
67
- "name": "onClear",
68
- "type": "(event: React.SyntheticEvent<HTMLButtonElement>) => void",
69
- "description": "A callback for when the user clicks the clear button."
70
- },
71
- {
72
- "name": "onSearch",
73
- "type": "(\n event: React.SyntheticEvent<HTMLButtonElement>,\n value: string,\n attrValueMap: { [key: string]: string }\n) => void",
74
- "description": "A callback for when the search button is clicked."
75
- },
76
- {
77
- "name": "onToggleAdvancedMenu",
78
- "type": "(e: React.SyntheticEvent<HTMLButtonElement>) => void",
79
- "description": "A callback for when the open advanced search button is clicked."
80
- },
81
- {
82
- "name": "parentInputRef",
83
- "type": "React.RefObject<any>",
84
- "description": "Ref of the input element within the search input."
85
- },
86
- {
87
- "name": "parentRef",
88
- "type": "React.RefObject<any>",
89
- "description": "Ref of the div wrapping the whole search input."
90
- },
91
- {
92
- "name": "resetButtonLabel",
93
- "type": "string",
94
- "description": "Label for the button which resets the advanced search form and clears the search input.",
95
- "defaultValue": "'Reset'"
96
- },
97
- {
98
- "name": "submitSearchButtonLabel",
99
- "type": "string",
100
- "description": "Label for the button which calls the onSearch event handler.",
101
- "defaultValue": "'Search'"
102
- },
103
- {
104
- "name": "value",
105
- "type": "string",
106
- "description": "Value of the search input.",
107
- "defaultValue": "''"
108
- }
109
- ]
110
- },
111
- {
112
- "name": "SearchInputSearchAttribute",
113
- "description": "Properties for adding search attributes to an advanced search input. These properties must\nbe passed in as an object within an array to the search input component's attribute property.",
114
- "props": [
115
- {
116
- "name": "attr",
117
- "type": "string",
118
- "description": "The search attribute's value to be provided in the search input's query string.\nIt should have no spaces and be unique for every attribute.",
119
- "required": true
120
- },
121
- {
122
- "name": "display",
123
- "type": "React.ReactNode",
124
- "description": "The search attribute's display name. It is used to label the field in the advanced\nsearch menu.",
125
- "required": true
126
- }
127
- ]
128
- },
129
- {
130
- "name": "SearchInputExpandable",
131
- "description": "Properties for creating an expandable search input. These properties should be passed into\nthe search input component's expandableInput property.",
132
- "props": [
133
- {
134
- "name": "hasAnimations",
135
- "type": "boolean",
136
- "description": "Flag indicating animations should be enabled when the search input expands and collapses. Note: this will change the component's DOM structure. In a future breaking change release, this will become the default behavior and will no longer be needed."
137
- },
138
- {
139
- "name": "isExpanded",
140
- "type": "boolean",
141
- "description": "Flag to indicate if the search input is expanded.",
142
- "required": true
143
- },
144
- {
145
- "name": "onToggleExpand",
146
- "type": "(event: React.SyntheticEvent<HTMLButtonElement>, isExpanded: boolean) => void",
147
- "description": "Callback function to toggle the expandable search input.",
148
- "required": true
149
- },
150
- {
151
- "name": "toggleAriaLabel",
152
- "type": "string",
153
- "description": "An accessible label for the expandable search input toggle.",
154
- "required": true
155
- }
156
- ]
157
- }
158
- ],
159
- "cssPrefix": [
160
- "pf-v6-c-search-input"
161
- ],
162
- "examples": [
163
- "Basic",
164
- "Match with result count",
165
- "Match with navigable options",
166
- "With submit button",
167
- "Focus search input using ref",
168
- "With expandable button",
169
- "Advanced"
170
- ]
171
- };
172
- pageData.liveContext = {
173
- useRef,
174
- useState,
175
- RhUiExternalLinkFillIcon
176
- };
177
- pageData.examples = {
178
- 'Basic': props =>
179
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { SearchInput } from '@patternfly/react-core';\n\nexport const SearchInputBasic: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n\n const onChange = (value: string) => {\n setValue(value);\n };\n\n return (\n <SearchInput\n aria-label=\"Search basic example\"\n placeholder=\"Find by name\"\n value={value}\n onChange={(_event, value) => onChange(value)}\n onClear={() => onChange('')}\n />\n );\n};\n","title":"Basic","lang":"ts","className":""}}>
180
-
181
- </Example>,
182
- 'Match with result count': props =>
183
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { SearchInput } from '@patternfly/react-core';\n\nexport const SearchInputWithResultCount: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n const [resultsCount, setResultsCount] = useState(0);\n\n const onChange = (value: string) => {\n setValue(value);\n setResultsCount(3);\n };\n\n const onClear = () => {\n setValue('');\n setResultsCount(0);\n };\n\n return (\n <SearchInput\n aria-label=\"Match with result count\"\n placeholder=\"Find by name\"\n value={value}\n onChange={(_event, value) => onChange(value)}\n onClear={onClear}\n resultsCount={resultsCount}\n />\n );\n};\n","title":"Match with result count","lang":"ts","className":""}}>
184
-
185
- </Example>,
186
- 'Match with navigable options': props =>
187
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { SearchInput } from '@patternfly/react-core';\n\nexport const SearchInputWithNavigableOptions: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n const [resultsCount, setResultsCount] = useState(0);\n const [currentResult, setCurrentResult] = useState(1);\n\n const onChange = (value: string) => {\n setValue(value);\n setResultsCount(3);\n };\n\n const onClear = () => {\n setValue('');\n setResultsCount(0);\n setCurrentResult(1);\n };\n\n const onNext = () => {\n const newCurrentResult = currentResult + 1;\n setCurrentResult(newCurrentResult > resultsCount ? resultsCount : newCurrentResult);\n };\n\n const onPrevious = () => {\n const newCurrentResult = currentResult - 1;\n setCurrentResult(newCurrentResult > 0 ? newCurrentResult : 1);\n };\n\n return (\n <SearchInput\n aria-label=\"Search match with navigable options example\"\n placeholder=\"Find by name\"\n value={value}\n onChange={(_event, value) => onChange(value)}\n onClear={onClear}\n isNextNavigationButtonDisabled={currentResult === 3}\n isPreviousNavigationButtonDisabled={currentResult === 1}\n resultsCount={`${currentResult} / ${resultsCount}`}\n onNextClick={onNext}\n onPreviousClick={onPrevious}\n />\n );\n};\n","title":"Match with navigable options","lang":"ts","className":""}}>
188
-
189
- </Example>,
190
- 'With submit button': props =>
191
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { SearchInput } from '@patternfly/react-core';\n\nexport const SearchInputWithSubmitButton: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n\n return (\n <SearchInput\n aria-label=\"Search with submit button example\"\n placeholder=\"Find by name\"\n value={value}\n onChange={(_event, value) => setValue(value)}\n onSearch={(_event, value) => setValue(value)}\n onClear={() => setValue('')}\n />\n );\n};\n","title":"With submit button","lang":"ts","className":""}}>
192
-
193
- </Example>,
194
- 'Focus search input using ref': props =>
195
- <Example {...pageData} {...props} {...{"code":"import { useRef, useState } from 'react';\nimport { SearchInput, Button } from '@patternfly/react-core';\n\nexport const SearchInputFocusSearch: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n const ref: React.MutableRefObject<HTMLInputElement | null> = useRef(null);\n\n return (\n <>\n <SearchInput\n ref={ref}\n value={value}\n onChange={(_event, value) => setValue(value)}\n onClear={() => setValue('')}\n aria-label=\"Search focus using ref example\"\n />\n <Button onClick={() => ref.current && ref.current.focus()}>Focus on the search input</Button>\n </>\n );\n};\n","title":"Focus search input using ref","lang":"ts","className":""}}>
196
-
197
- </Example>,
198
- 'With expandable button': props =>
199
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { SearchInput } from '@patternfly/react-core';\n\nexport const SearchInputWithExpandable: React.FunctionComponent = () => {\n const [value, setValue] = useState('');\n const [isExpanded, setIsExpanded] = useState(false);\n\n const onChange = (value: string) => {\n setValue(value);\n };\n\n const onToggleExpand = (_event: React.SyntheticEvent<HTMLButtonElement>, isExpanded: boolean) => {\n setIsExpanded(!isExpanded);\n };\n\n return (\n <SearchInput\n aria-label=\"Search with expandable button example\"\n placeholder=\"Find by name\"\n value={value}\n onChange={(_event, value) => onChange(value)}\n onClear={() => onChange('')}\n expandableInput={{\n isExpanded,\n onToggleExpand,\n toggleAriaLabel: 'Expandable search input toggle',\n hasAnimations: true\n }}\n />\n );\n};\n","title":"With expandable button","lang":"ts","className":""}}>
200
-
201
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
202
- {`Animations on the expansion and collapse of the search input may be opted into by passing `}
203
-
204
- <code {...{"className":"ws-code "}}>
205
- {`hasAnimations`}
206
- </code>
207
- {` to the `}
208
-
209
- <code {...{"className":"ws-code "}}>
210
- {`expandableInput`}
211
- </code>
212
- {` object.`}
213
- </p>
214
- </Example>,
215
- 'Advanced': props =>
216
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Button, Checkbox, FormGroup, SearchInput } from '@patternfly/react-core';\nimport RhUiExternalLinkFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-external-link-fill-icon';\n\nexport const SearchInputAdvanced: React.FunctionComponent = () => {\n const [value, setValue] = useState('username:player firstname:john');\n const [useEqualsAsDelimiter, setUseEqualsAsDelimiter] = useState(false);\n const [useCustomFooter, setUseCustomFooter] = useState(false);\n\n const toggleDelimiter = (checked: boolean) => {\n setValue(value.replace(/:|=/g, checked ? '=' : ':'));\n setUseEqualsAsDelimiter(checked);\n };\n\n return (\n <>\n <Checkbox\n label=\"Use equal sign as search attribute delimiter\"\n isChecked={useEqualsAsDelimiter}\n onChange={(_event, checked) => toggleDelimiter(checked)}\n aria-label=\"change delimiter checkbox\"\n id=\"toggle-delimiter\"\n name=\"toggle-delimiter\"\n />\n <Checkbox\n label=\"Add custom footer element after the attributes in the menu\"\n isChecked={useCustomFooter}\n onChange={(_event, checked) => setUseCustomFooter(checked)}\n aria-label=\"change use custom footer checkbox\"\n id=\"toggle-custom-footer\"\n name=\"toggle-custom-footer\"\n />\n <br />\n <SearchInput\n aria-label=\"Advanced search\"\n attributes={[\n { attr: 'username', display: 'Username' },\n { attr: 'firstname', display: 'First name' }\n ]}\n advancedSearchDelimiter={useEqualsAsDelimiter ? '=' : ':'}\n value={value}\n onChange={(_event, value) => setValue(value)}\n onSearch={(_event, value) => setValue(value)}\n onClear={() => setValue('')}\n formAdditionalItems={\n useCustomFooter ? (\n <FormGroup>\n <Button variant=\"link\" isInline icon={<RhUiExternalLinkFillIcon />} iconPosition=\"end\">\n Link\n </Button>\n </FormGroup>\n ) : null\n }\n />\n </>\n );\n};\n","title":"Advanced","lang":"ts","className":""}}>
217
-
218
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
219
- {`The search input component can be used to dynamically build a one to one attribute-value advanced search.
220
- Using the `}
221
-
222
- <code {...{"className":"ws-code "}}>
223
- {`attributes`}
224
- </code>
225
- {` prop alongside the `}
226
-
227
- <code {...{"className":"ws-code "}}>
228
- {`advancedSearchDelimiter`}
229
- </code>
230
- {` will expose this functionality, as demonstrated in
231
- the following example. The search input component can also be used as a composable component and paired with a Popper
232
- or other elements to build a completely custom advanced search form. This feature is demonstrated
233
- in the search input's `}
234
- <a href="/components/search-input/react-demos">{`react demos`}</a>
235
- {`.`}
236
- </p>
237
-
238
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
239
- {`The values used in the attribute-value form fields may contain spaces. The values containing spaces
240
- should be wrapped with quotes inside the summary search string in the input field. If the latter is
241
- autogenerated from the individual fields the quotes will be autoplaced.`}
242
- </p>
243
- </Example>
244
- };
245
-
246
- const Component = () => (
247
- <React.Fragment>
248
- <AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
249
- {`Examples`}
250
- </AutoLinkHeader>
251
- {React.createElement(pageData.examples["Basic"])}
252
- {React.createElement(pageData.examples["Match with result count"])}
253
- {React.createElement(pageData.examples["Match with navigable options"])}
254
- {React.createElement(pageData.examples["With submit button"])}
255
- {React.createElement(pageData.examples["Focus search input using ref"])}
256
- {React.createElement(pageData.examples["With expandable button"])}
257
- {React.createElement(pageData.examples["Advanced"])}
258
- </React.Fragment>
259
- );
260
- Component.displayName = 'ComponentsSearchInputReactDocs';
261
- Component.pageData = pageData;
262
-
263
- export default Component;