Skip to content

Commit d01deba

Browse files
committed
Add documentation for a common select
1 parent 5588814 commit d01deba

File tree

5 files changed

+80
-2
lines changed

5 files changed

+80
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import SelectCommon from '../select.md';
2+
3+
<SelectCommon/>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import SelectCommon from '../select.md';
2+
3+
<SelectCommon/>

packages/react-renderer-demo/src/doc-components/examples-texts/pf4/select.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ const asyncLoadOptions = (searchValue) => new Promise(resolve => setTimeout(() =
2929

3030
return resolve(options);
3131
}, 2000));
32-
```
32+
```
33+
34+
import SelectCommon from '../select.md';
35+
36+
<SelectCommon/>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import Chip from '@material-ui/core/Chip';
2+
3+
## Common select features
4+
5+
This mapper component is using the common select component to provide additional features.
6+
7+
## loadOptions
8+
9+
*(currentSearchValue: string) => Promise< Options >*
10+
11+
Using `loadOptions` function you can dynamically load options when the component is mounted or when the value in search bar is changed. You can also trigger a reload via changing `loadOptionsChangeCounter` *number* attribute.
12+
13+
---
14+
15+
## simpleValue
16+
17+
*boolean*
18+
19+
When is `true`, the select will store only values of the selected options. Otherwise, it stores the whole objects.
20+
21+
---
22+
23+
## selectAll
24+
25+
*boolean* | <Chip label="Experimental" color="secondary" />
26+
27+
When provided to an option object, this option will select all available options.
28+
29+
```jsx
30+
options: [{
31+
label: 'Select all',
32+
value: 'select-all',
33+
selectAll: true,
34+
},
35+
...
36+
]
37+
```
38+
39+
---
40+
41+
## selectNone
42+
43+
*boolean* | <Chip label="Experimental" color="secondary" />
44+
45+
46+
When provided to an option object, this option will clear the selection.
47+
48+
```jsx
49+
options: [{
50+
label: 'Select none',
51+
value: 'select-none',
52+
selectNone: true,
53+
},
54+
...
55+
]
56+
```
57+
58+
---
59+
60+
## noValueUpdates
61+
62+
*boolean*
63+
64+
By default, the common select unselects values that are not available as an option. If you want to disable this behavior, you can do it via setting this option to `true`.

packages/react-renderer-demo/src/doc-components/examples-texts/suir/select.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
|name|type|default|target component|
33
|----|----|-------|----------------|
44
|FormFieldGridProps|object|`{}`|`div`|
5-
|HelperTextProps|object|`{}`|`p`|
5+
|HelperTextProps|object|`{}`|`p`|
6+
7+
import SelectCommon from '../select.md';
8+
9+
<SelectCommon/>

0 commit comments

Comments
 (0)