You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* As part of
inveniosoftware/react-invenio-forms#298, UI
widgets are being given a standardised common set of props (on top of
which each widget can have additional, more specific props)
* This PR changes the reference docs for custom field widgets by
splitting into the two distinct sections of "common props" and
"widget-specific props"
Copy file name to clipboardExpand all lines: docs/operate/customize/metadata/custom_fields/widgets.md
+25-91Lines changed: 25 additions & 91 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,28 @@ _Introduced in v10_
4
4
5
5
The following document is a reference guide for all the React UI widgets available for custom fields.
6
6
7
+
## Common props
8
+
9
+
These props are applicable to all widgets. In the reference below, only props additional to these are shown for each widget.
10
+
11
+
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
12
+
13
+
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
14
+
15
+
-**labelIcon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
16
+
- Previously known as **icon**.
17
+
18
+
-**placeholder**`String`: The placeholder for the element's display. You should fill this in with an example value.
19
+
20
+
-**helpText**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
21
+
- Previously known as **description**.
22
+
23
+
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
24
+
25
+
-**disabled**`Boolean`_optional_: Define if the field should be displayed as disabled thus no input can be filled.
26
+
27
+
-**hidden**`Boolean`_optional_: Define if the field should be hidden completely. Hiding a field will still retain any value that it already contained.
28
+
7
29
## Input
8
30
9
31
An input field for a single string value.
@@ -23,19 +45,7 @@ An input field for a single string value.
23
45
24
46
### Props
25
47
26
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
27
-
28
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
29
-
30
-
-**placeholder**`String`_required_: The placeholder for the element's display. You should fill this in with an example value.
31
-
32
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
33
-
34
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
35
-
36
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
37
-
38
-
-**disabled**`Boolean`_optional_: Define if the field should be displayed as disabled thus no input can be filled.
48
+
No additional props.
39
49
40
50
## NumberInput
41
51
@@ -56,19 +66,7 @@ An input field for numbers e.g. integers, float etc.
56
66
57
67
### Props
58
68
59
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
60
-
61
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
62
-
63
-
-**placeholder**`String`_required_: The placeholder for the element's display. You should fill this in with an example value.
64
-
65
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
66
-
67
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
68
-
69
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
70
-
71
-
-**disabled**`Boolean`_optional_: Define if the field should be displayed as disabled thus no input can be filled.
69
+
No additional props.
72
70
73
71
## MultiInput
74
72
@@ -90,18 +88,6 @@ An input field for multiple string values.
90
88
91
89
### Props
92
90
93
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
94
-
95
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
96
-
97
-
-**placeholder**`String`_required_: The placeholder for the element's display. You should fill this in with an example value.
98
-
99
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
100
-
101
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
102
-
103
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
104
-
105
91
-**additionLabel**`String`_optional_: The label to show when a user is adding a new value.
106
92
107
93
#### Warning
@@ -127,16 +113,6 @@ A rich input field for HTML text, with a WYSIWYG editor.
127
113
128
114
### Props
129
115
130
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
131
-
132
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
133
-
134
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
135
-
136
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
137
-
138
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
139
-
140
116
-**editorConfig**`Object`_optional_: The config to pass to the underlying HTML WYSIWYG editor as described in the [CKEditor configuration](https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html) page.
141
117
142
118
## TextArea
@@ -157,15 +133,7 @@ An input field for multi line text.
157
133
158
134
### Props
159
135
160
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
161
-
162
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
163
-
164
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
165
-
166
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
167
-
168
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
136
+
No additional props.
169
137
170
138
## Dropdown
171
139
@@ -189,18 +157,6 @@ A dropdown field that renders the complete list of possible options, where the u
189
157
190
158
### Props
191
159
192
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
193
-
194
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
195
-
196
-
-**placeholder**`String`_required_: The placeholder for the element's display. You should fill this in with an example value.
197
-
198
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
199
-
200
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
201
-
202
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
203
-
204
160
-**search**`Boolean`_optional_: Define if the user should be able to search in the current available options.
205
161
206
162
-**clearable**`Boolean`_optional_: Define if the user can deselect all the selected values.
@@ -230,23 +186,11 @@ A dropdown field that allows the user to search for values, connected to the RES
230
186
231
187
### Props
232
188
233
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
234
-
235
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
236
-
237
-
-**placeholder**`String`_required_: The placeholder for the element's display. You should fill this in with an example value.
238
-
239
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
240
-
241
189
-**autocompleteFrom**`String`_required_: The endpoint from which the component should fetch options. This will point to your vocabulary endpoint e.g. `/api/vocabularies/myvocabulary`.
242
190
243
191
-**autocompleteFromAcceptHeader**`String`_optional_: The `Accept` header to send to the `autocompleteFrom` API. If not provided, the **default** header is
244
192
`application/vnd.inveniordm.v1+json`.
245
193
246
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
247
-
248
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
249
-
250
194
-**clearable**`Boolean`_optional_: Define if the user can deselect all the selected values.
251
195
252
196
-**multiple**`Boolean`_optional_ : Define if the field accepts multiple values.
@@ -269,16 +213,6 @@ A field for boolean values. It displays 2 checkboxes for each corresponding valu
269
213
270
214
### Props
271
215
272
-
-**fieldPath**`String`_required_: The path to the field e.g. `cern:experiment`.
273
-
274
-
-**label**`String`_required_: The label for the element's display. This is used whenever the field should be displayed e.g. upload form, landing page etc.
275
-
276
216
-**trueLabel**`String`_required_: The label for the element's display when the value is `true`. This is used whenever the `true` value should be displayed e.g. upload form, landing page etc.
277
217
278
218
-**falseLabel**`String`_required_: The label for the element's display when the value is `false`. This is used whenever the `false` value should be displayed e.g. upload form, landing page etc.
279
-
280
-
-**description**`String`_required_: The description for the element's display. You should provide useful information on how the users should fill this field in.
281
-
282
-
-**icon**`String`_optional_: The optional icon that your field might have. The value should be one of the [Semantic UI icons](https://react.semantic-ui.com/elements/icon/).
283
-
284
-
-**required**`Boolean`_optional_: Define if the field should be required i.e. display the `*` symbol.
0 commit comments