@@ -23,6 +23,7 @@ type Props = {
23
23
/**
24
24
* Optionally pass an array of fields that should be editable
25
25
*
26
+ * ```
26
27
* [
27
28
* {
28
29
* path: ['username'],
@@ -33,6 +34,7 @@ type Props = {
33
34
* required: true,
34
35
* }
35
36
* ]
37
+ * ```
36
38
*/
37
39
editFields ?: Array < FieldConfig >
38
40
/**
@@ -43,6 +45,7 @@ type Props = {
43
45
/**
44
46
* Labels to show in the list
45
47
*
48
+ * ```
46
49
* [
47
50
* {
48
51
* label: 'Username',
@@ -53,15 +56,16 @@ type Props = {
53
56
* path: ['password']
54
57
* },
55
58
* ]
59
+ * ```
56
60
*/
57
61
labels : Labels
58
62
/**
59
63
* Callback when any field in the form is modified.
60
- * If this property is set, the form becomes a controlled component and the value
61
- * prop must be maintained externally.
64
+ * If this property is set, the form becomes a controlled component
65
+ * and the value prop must be maintained externally.
62
66
*
63
- * This is useful if you nest multiple FormHelpers or need to restrict user input
64
- * before it appear on the screen.
67
+ * This is useful if you nest multiple FormHelpers or need to
68
+ * restrict user input before it appear on the screen.
65
69
*/
66
70
onChange : ( updatedList ) => void
67
71
/**
@@ -70,7 +74,8 @@ type Props = {
70
74
edit : any
71
75
setEdit : Function
72
76
/**
73
- * Set to true to only show error messages for fields that have been touched
77
+ * Set to true to only show error messages for fields that
78
+ * have been touched
74
79
*/
75
80
errorOnTouched ?: boolean
76
81
/**
@@ -112,6 +117,8 @@ const enhance = compose(
112
117
/**
113
118
* Component for displaying a list of items, which handles editing and removal.
114
119
*
120
+ * ##### Example
121
+ * ```
115
122
* const enhance = compose(
116
123
* withState('user', 'setUser', [{username: 'test', password: 'test'}]),
117
124
* withState('editUser', 'setEditUser', null),
@@ -144,6 +151,7 @@ const enhance = compose(
144
151
* edit={editUser}
145
152
* setEdit={setEditUser}
146
153
* />
154
+ * ```
147
155
*/
148
156
export const EditList = enhance ( ( {
149
157
value : list , onChange, labels, editFields, mapFields, edit, setEdit,
0 commit comments