Skip to content

Commit ef044c6

Browse files
committed
Adds MUI dual list to documentation
1 parent 4eb71e6 commit ef044c6

File tree

3 files changed

+91
-2
lines changed

3 files changed

+91
-2
lines changed

packages/react-renderer-demo/src/app/pages/component-example/dual-list-select.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import ComponentText from '@docs/components/component-example-text';
33
import useComponentExample from '../../src/hooks/use-component-example';
44
import Pf4DualListSelect from '@data-driven-forms/pf4-component-mapper/dist/cjs/dual-list-select';
5+
import MuiDualListSelect from '@data-driven-forms/mui-component-mapper/dist/cjs/dual-list-select';
56

67
const mappers = {
78
pf4: {
@@ -11,7 +12,7 @@ const mappers = {
1112
'dual-list-select': () => <h2>Not implemented</h2>
1213
},
1314
mui: {
14-
'dual-list-select': () => <h2>Not implemented</h2>
15+
'dual-list-select': MuiDualListSelect
1516
}
1617
};
1718

packages/react-renderer-demo/src/app/src/components/navigation/examples-texts/dual-list-select.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
import React from 'react';
22
import Pf4 from '@docs/doc-components/pf4-dual-list.md';
3+
import MUI from '@docs/doc-components/mui-dual-list.md';
4+
35
import PropTypes from 'prop-types';
46

5-
const DualListSelect = ({ activeMapper }) => (activeMapper === 'pf4' ? <Pf4 /> : 'Not implemented yet');
7+
const DualListSelect = ({ activeMapper }) => {
8+
if (activeMapper === 'pf4') {
9+
return <Pf4 />;
10+
}
11+
12+
if (activeMapper === 'mui') {
13+
return <MUI />;
14+
}
15+
16+
return 'Not implemented yet';
17+
};
618

719
DualListSelect.propTypes = {
820
activeMapper: PropTypes.string
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
This a custom component with a custom design.
2+
3+
**Props**
4+
5+
Dual list select is wrapped in a form group, so it accepts all [form group props](/renderer/component-api#formgroupwrappedcomponents).
6+
7+
|Props|Type|Default|Description|
8+
|-----|----|-------|-----------|
9+
|options|array|[]|`[{label, value, ...props}]` *see below*|
10+
|leftTitle|String|'Options'|Title for options|
11+
|rightTitle|String|'Selected'|Title for selected items|
12+
|moveLeftTitle|String|'Move selected to left'|Tooltip for move to left button|
13+
|moveRightTitle|String|'Move selected to right'|Tooltip for move to right button|
14+
|moveAllLeftTitle|String|'Move all to left'|Tooltip for move all to left button|
15+
|moveAllRightTitle|String|'Move all to right'|Tooltip for move all to right button|
16+
|allToLeft|Boolean|true|Hides all to left button|
17+
|allToRight|Boolean|true|Hides all to right button|
18+
|noValueTitle|String|'No selected'|Placeholder for empty value|
19+
|noOptionsTitle|String|'No available options'|Placeholder for empty options|
20+
|filterOptionsTitle|String|'Filter options'|Placeholder for options filter input|
21+
|filterValueTitle|String|'Filter selected value'|Placeholder for value filter input|
22+
|filterValueText|String|'Remove your filter to see all selected'|Placeholder for value when there is no filtered value|
23+
|filterOptionsText|String|'Remove your filter to see all options'|Placeholder for options when there is no filtered option|
24+
|checkboxVariant|bool|false|Change list item to checkboxes|
25+
26+
**Options**
27+
28+
|Props|Type|Description|
29+
|-----|----|-----------|
30+
|value|string|Value of the option|
31+
|label|node|ListItemText primary text|
32+
|icon|element|Icon for the ListItemIcon|
33+
|isCheckbox|bool|Checkbox variant|
34+
|secondaryActions|element|Children of secondaryActions component|
35+
|ListItemProps|object|Props passed to ListItem|
36+
|ListItemIconProps|object|Props passed to ListItemIcon|
37+
|ListItemTextProps|object|Props passed to ListItemText|
38+
|ListItemSecondaryActionProps|object|Props passed to ListItemSecondaryAction|
39+
40+
**Customization**
41+
42+
MUI DualListSelect provides fully customization. When the props offers Right/Left variant, you can pass props to `RightXXX` or to `LeftXXX` props. Example: `ListGridProps` is Right/Left, so there are two more props: `RightListGridProps` and `LeftListGridProps`. These props overrides the standard props, except `className`, that are being combined. All these props are objects.
43+
44+
|Props|Right/Left variant|
45+
|-----|----|
46+
|FormFieldGridProps||
47+
|InternalGridProps||
48+
|ListGridProps|yes|
49+
|ListProps|yes|
50+
|ButtonsGridProps||
51+
|ButtonsInternalGridProps||
52+
|ButtonGridProps||
53+
|ToRightGridProps||
54+
|IconButtonProps||
55+
|ToRightIconButtonProps||
56+
|IconProps||
57+
|AllToLeftIconProps||
58+
|AllToRightGridProps||
59+
|AllToRightIconButtonProps||
60+
|AllToLeftGridProps||
61+
|AllToLeftIconButtonProps||
62+
|ToLeftGridProps||
63+
|ToLeftIconProps||
64+
|ToLeftIconButtonProps||
65+
|ListItemProps|yes|
66+
|ListItemIconProps|yes|
67+
|ListItemTextProps|yes|
68+
|ListItemSecondaryActionProps|yes|
69+
|FormControlProps||
70+
|FormLabelProps||
71+
|FormHelperTextProps||
72+
|TitleProps|yes|
73+
|ToolbarProps|yes|
74+
|FilterFieldProps|yes|
75+
|SortIconButtonProps|yes|
76+
|SortIconProps|yes|

0 commit comments

Comments
 (0)