@dhis2/ui 8.2.5 → 8.3.1
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.
- package/API.md +1479 -1253
- package/package.json +48 -48
package/API.md
CHANGED
|
@@ -4,26 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
```js
|
|
8
9
|
import { AlertBar } from '@dhis2/ui'
|
|
9
10
|
```
|
|
10
11
|
|
|
12
|
+
|
|
11
13
|
#### Props
|
|
12
14
|
|
|
13
|
-
|
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
15
|
+
|Name|Type|Default|Required|Description|
|
|
16
|
+
|---|---|---|---|---|
|
|
17
|
+
|actions|custom|||An array of 0-2 action objects|
|
|
18
|
+
|children|string|||The message string for the alert|
|
|
19
|
+
|className|string||||
|
|
20
|
+
|critical|custom|||Alert bars with `critical` will not autohide|
|
|
21
|
+
|dataTest|string|`'dhis2-uicore-alertbar'`|||
|
|
22
|
+
|duration|number|`8000`|||
|
|
23
|
+
|hidden|boolean||||
|
|
24
|
+
|icon|custom|`true`||A specific icon to override the default icon in the bar.<br/>If `false` is provided, no icon will be shown.|
|
|
25
|
+
|permanent|boolean||||
|
|
26
|
+
|success|custom||||
|
|
27
|
+
|warning|custom|||Alert bars with `warning` will not autohide|
|
|
28
|
+
|onHidden|function||||
|
|
27
29
|
|
|
28
30
|
### AlertStack
|
|
29
31
|
|
|
@@ -31,17 +33,19 @@ import { AlertBar } from '@dhis2/ui'
|
|
|
31
33
|
|
|
32
34
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
33
35
|
|
|
36
|
+
|
|
34
37
|
```js
|
|
35
38
|
import { AlertStack } from '@dhis2/ui'
|
|
36
39
|
```
|
|
37
40
|
|
|
41
|
+
|
|
38
42
|
#### Props
|
|
39
43
|
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
44
|
+
|Name|Type|Default|Required|Description|
|
|
45
|
+
|---|---|---|---|---|
|
|
46
|
+
|children|node||||
|
|
47
|
+
|className|string||||
|
|
48
|
+
|dataTest|string|`'dhis2-uicore-alertstack'`|||
|
|
45
49
|
|
|
46
50
|
### Box
|
|
47
51
|
|
|
@@ -49,25 +53,27 @@ import { AlertStack } from '@dhis2/ui'
|
|
|
49
53
|
|
|
50
54
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
51
55
|
|
|
56
|
+
|
|
52
57
|
```js
|
|
53
58
|
import { Box } from '@dhis2/ui'
|
|
54
59
|
```
|
|
55
60
|
|
|
61
|
+
|
|
56
62
|
#### Props
|
|
57
63
|
|
|
58
|
-
|
|
|
59
|
-
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
64
|
+
|Name|Type|Default|Required|Description|
|
|
65
|
+
|---|---|---|---|---|
|
|
66
|
+
|children|node||||
|
|
67
|
+
|className|string||||
|
|
68
|
+
|dataTest|string|`'dhis2-uicore-box'`|||
|
|
69
|
+
|height|string||||
|
|
70
|
+
|marginTop|string||||
|
|
71
|
+
|maxHeight|string||||
|
|
72
|
+
|maxWidth|string||||
|
|
73
|
+
|minHeight|string||||
|
|
74
|
+
|minWidth|string||||
|
|
75
|
+
|overflow|string||||
|
|
76
|
+
|width|string||||
|
|
71
77
|
|
|
72
78
|
### Button
|
|
73
79
|
|
|
@@ -75,34 +81,36 @@ import { Box } from '@dhis2/ui'
|
|
|
75
81
|
|
|
76
82
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
77
83
|
|
|
84
|
+
|
|
78
85
|
```js
|
|
79
86
|
import { Button } from '@dhis2/ui'
|
|
80
87
|
```
|
|
81
88
|
|
|
89
|
+
|
|
82
90
|
#### Props
|
|
83
91
|
|
|
84
|
-
|
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
92
|
+
|Name|Type|Default|Required|Description|
|
|
93
|
+
|---|---|---|---|---|
|
|
94
|
+
|children|node|||Component to render inside the button|
|
|
95
|
+
|className|string|||A className that will be passed to the `<button>` element|
|
|
96
|
+
|dataTest|string|`'dhis2-uicore-button'`||A string that will be applied as a `data-test` attribute on the button element<br/>for identification during testing|
|
|
97
|
+
|destructive|custom|||Indicates that the button makes potentially dangerous<br/>deletions or data changes.<br/>Mutually exclusive with `primary` and `secondary` props|
|
|
98
|
+
|disabled|boolean|||Applies a greyed-out appearance and makes the button non-interactive|
|
|
99
|
+
|icon|element|||An icon element to display inside the button|
|
|
100
|
+
|initialFocus|boolean|||Use this variant to capture the initial focus on the page.|
|
|
101
|
+
|large|custom|||Makes the button large. Mutually exclusive with `small`|
|
|
102
|
+
|loading|boolean|||Sets the button into a loading state|
|
|
103
|
+
|name|string|||Sets `name` attribute on button element.<br/>Gets passed as part of the first argument to callbacks (see `onClick`).|
|
|
104
|
+
|primary|custom|||Applies 'primary' button appearance.<br/>Mutually exclusive with `destructive` and `secondary` props|
|
|
105
|
+
|secondary|custom|||Applies 'secondary' button appearance.<br/>Mutually exclusive with `primary` and `destructive` props|
|
|
106
|
+
|small|custom|||Makes the button small. Mutually exclusive with `large` prop|
|
|
107
|
+
|tabIndex|string|||Tab index for focusing the button with a keyboard|
|
|
108
|
+
|toggled|boolean|||Changes appearance of button to an on/off state|
|
|
109
|
+
|type|'submit' │ 'reset' │ 'button'|`'button'`||Sets `type` attribute on `<button>` element|
|
|
110
|
+
|value|string|||Value associated with the button.<br/>Gets passed as part of the first argument to callbacks (see `onClick`).|
|
|
111
|
+
|onBlur|function|||Callback to trigger on de-focus (blur).<br/>Called with same args as `onClick`|
|
|
112
|
+
|onClick|function|||Callback to trigger on click.<br/>Called with args `({ value, name }, event)`|
|
|
113
|
+
|onFocus|function|||Callback to trigger on focus. Called with same args as `onClick`|
|
|
106
114
|
|
|
107
115
|
### ButtonStrip
|
|
108
116
|
|
|
@@ -110,19 +118,21 @@ import { Button } from '@dhis2/ui'
|
|
|
110
118
|
|
|
111
119
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
112
120
|
|
|
121
|
+
|
|
113
122
|
```js
|
|
114
123
|
import { ButtonStrip } from '@dhis2/ui'
|
|
115
124
|
```
|
|
116
125
|
|
|
126
|
+
|
|
117
127
|
#### Props
|
|
118
128
|
|
|
119
|
-
|
|
|
120
|
-
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
129
|
+
|Name|Type|Default|Required|Description|
|
|
130
|
+
|---|---|---|---|---|
|
|
131
|
+
|children|node||||
|
|
132
|
+
|className|string||||
|
|
133
|
+
|dataTest|string|`'dhis2-uicore-buttonstrip'`|||
|
|
134
|
+
|end|custom|||Horizontal alignment for buttons. Mutually exclusive with `middle` prop|
|
|
135
|
+
|middle|custom|||Horizontal alignment. Mutually exclusive with `end` prop|
|
|
126
136
|
|
|
127
137
|
### DropdownButton
|
|
128
138
|
|
|
@@ -130,32 +140,34 @@ import { ButtonStrip } from '@dhis2/ui'
|
|
|
130
140
|
|
|
131
141
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
132
142
|
|
|
143
|
+
|
|
133
144
|
```js
|
|
134
145
|
import { DropdownButton } from '@dhis2/ui'
|
|
135
146
|
```
|
|
136
147
|
|
|
148
|
+
|
|
137
149
|
#### Props
|
|
138
150
|
|
|
139
|
-
|
|
|
140
|
-
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
151
|
+
|Name|Type|Default|Required|Description|
|
|
152
|
+
|---|---|---|---|---|
|
|
153
|
+
|children|node|||Children to render inside the buton|
|
|
154
|
+
|className|string||||
|
|
155
|
+
|component|element|||Component to show/hide when button is clicked|
|
|
156
|
+
|dataTest|string|`'dhis2-uicore-dropdownbutton'`|||
|
|
157
|
+
|destructive|custom|||Button variant. Mutually exclusive with `primary` and `secondary` props|
|
|
158
|
+
|disabled|boolean|||Make the button non-interactive|
|
|
159
|
+
|icon|element||||
|
|
160
|
+
|initialFocus|boolean|||Grants button initial focus on the page|
|
|
161
|
+
|large|custom|||Button size. Mutually exclusive with `small` prop|
|
|
162
|
+
|name|string||||
|
|
163
|
+
|open|boolean|||Controls popper visibility. When implementing this prop the component becomes a controlled component|
|
|
164
|
+
|primary|custom|||Button variant. Mutually exclusive with `destructive` and `secondary` props|
|
|
165
|
+
|secondary|custom|||Button variant. Mutually exclusive with `primary` and `destructive` props|
|
|
166
|
+
|small|custom|||Button size. Mutually exclusive with `large` prop|
|
|
167
|
+
|tabIndex|string||||
|
|
168
|
+
|type|'submit' │ 'reset' │ 'button'|||Type of button. Can take advantage of different default behavior|
|
|
169
|
+
|value|string||||
|
|
170
|
+
|onClick|custom|||Callback triggered on click.<br/>Called with signature `({ name: string, value: string, open: bool }, event)`<br/>Is required when using the `open` prop to override the internal<br/>state.|
|
|
159
171
|
|
|
160
172
|
### SplitButton
|
|
161
173
|
|
|
@@ -163,31 +175,33 @@ import { DropdownButton } from '@dhis2/ui'
|
|
|
163
175
|
|
|
164
176
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
165
177
|
|
|
178
|
+
|
|
166
179
|
```js
|
|
167
180
|
import { SplitButton } from '@dhis2/ui'
|
|
168
181
|
```
|
|
169
182
|
|
|
183
|
+
|
|
170
184
|
#### Props
|
|
171
185
|
|
|
172
|
-
|
|
|
173
|
-
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
186
|
+
|Name|Type|Default|Required|Description|
|
|
187
|
+
|---|---|---|---|---|
|
|
188
|
+
|children|string||||
|
|
189
|
+
|className|string||||
|
|
190
|
+
|component|element|||Component to render when the dropdown is opened|
|
|
191
|
+
|dataTest|string|`'dhis2-uicore-splitbutton'`|||
|
|
192
|
+
|destructive|custom|||Applies 'destructive' appearance to indicate purpose. Mutually exclusive with `primary` and `secondary` props|
|
|
193
|
+
|disabled|boolean|||Disables the button and makes it uninteractive|
|
|
194
|
+
|icon|element|||An icon to add inside the button|
|
|
195
|
+
|initialFocus|boolean|||Grants the button the initial focus|
|
|
196
|
+
|large|custom|||Changes button size. Mutually exclusive with `small` prop|
|
|
197
|
+
|name|string||||
|
|
198
|
+
|primary|custom|||Applies 'primary' appearance to indicate purpose. Mutually exclusive with `destructive` and `secondary` props|
|
|
199
|
+
|secondary|custom|||Applies 'secondary' appearance to indicate purpose. Mutually exclusive with `primary` and `destructive` props|
|
|
200
|
+
|small|custom|||Changes button size. Mutually exclusive with `large` prop|
|
|
201
|
+
|tabIndex|string||||
|
|
202
|
+
|type|'submit' │ 'reset' │ 'button'|||Type of button. Applied to html `button` element|
|
|
203
|
+
|value|string|||Value associated with the button. Passed in object to onClick handler|
|
|
204
|
+
|onClick|function||||
|
|
191
205
|
|
|
192
206
|
### Card
|
|
193
207
|
|
|
@@ -195,17 +209,19 @@ import { SplitButton } from '@dhis2/ui'
|
|
|
195
209
|
|
|
196
210
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
197
211
|
|
|
212
|
+
|
|
198
213
|
```js
|
|
199
214
|
import { Card } from '@dhis2/ui'
|
|
200
215
|
```
|
|
201
216
|
|
|
217
|
+
|
|
202
218
|
#### Props
|
|
203
219
|
|
|
204
|
-
|
|
|
205
|
-
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
220
|
+
|Name|Type|Default|Required|Description|
|
|
221
|
+
|---|---|---|---|---|
|
|
222
|
+
|children|node||||
|
|
223
|
+
|className|string||||
|
|
224
|
+
|dataTest|string|`'dhis2-uicore-card'`|||
|
|
209
225
|
|
|
210
226
|
### Center
|
|
211
227
|
|
|
@@ -213,18 +229,20 @@ import { Card } from '@dhis2/ui'
|
|
|
213
229
|
|
|
214
230
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
215
231
|
|
|
232
|
+
|
|
216
233
|
```js
|
|
217
234
|
import { Center } from '@dhis2/ui'
|
|
218
235
|
```
|
|
219
236
|
|
|
237
|
+
|
|
220
238
|
#### Props
|
|
221
239
|
|
|
222
|
-
|
|
|
223
|
-
|
|
224
|
-
|
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
240
|
+
|Name|Type|Default|Required|Description|
|
|
241
|
+
|---|---|---|---|---|
|
|
242
|
+
|children|node||||
|
|
243
|
+
|className|string||||
|
|
244
|
+
|dataTest|string|`'dhis2-uicore-centeredcontent'`|||
|
|
245
|
+
|position|'top' │ 'middle' │ 'bottom'|`'middle'`||Vertical alignment|
|
|
228
246
|
|
|
229
247
|
### Checkbox
|
|
230
248
|
|
|
@@ -232,31 +250,33 @@ import { Center } from '@dhis2/ui'
|
|
|
232
250
|
|
|
233
251
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
234
252
|
|
|
253
|
+
|
|
235
254
|
```js
|
|
236
255
|
import { Checkbox } from '@dhis2/ui'
|
|
237
256
|
```
|
|
238
257
|
|
|
258
|
+
|
|
239
259
|
#### Props
|
|
240
260
|
|
|
241
|
-
|
|
|
242
|
-
|
|
243
|
-
|
|
|
244
|
-
|
|
|
245
|
-
|
|
|
246
|
-
|
|
|
247
|
-
|
|
|
248
|
-
|
|
|
249
|
-
|
|
|
250
|
-
|
|
|
251
|
-
|
|
|
252
|
-
|
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
|
|
|
258
|
-
|
|
|
259
|
-
|
|
|
261
|
+
|Name|Type|Default|Required|Description|
|
|
262
|
+
|---|---|---|---|---|
|
|
263
|
+
|checked|custom|`false`|||
|
|
264
|
+
|className|string||||
|
|
265
|
+
|dataTest|string|`'dhis2-uicore-checkbox'`|||
|
|
266
|
+
|dense|boolean||||
|
|
267
|
+
|disabled|boolean||||
|
|
268
|
+
|error|custom||||
|
|
269
|
+
|indeterminate|custom|`false`|||
|
|
270
|
+
|initialFocus|boolean||||
|
|
271
|
+
|label|node||||
|
|
272
|
+
|name|string||||
|
|
273
|
+
|tabIndex|string||||
|
|
274
|
+
|valid|custom||||
|
|
275
|
+
|value|string||||
|
|
276
|
+
|warning|custom||||
|
|
277
|
+
|onBlur|function||||
|
|
278
|
+
|onChange|function|||Called with signature `(object, event)`|
|
|
279
|
+
|onFocus|function||||
|
|
260
280
|
|
|
261
281
|
### CheckboxField
|
|
262
282
|
|
|
@@ -264,33 +284,35 @@ import { Checkbox } from '@dhis2/ui'
|
|
|
264
284
|
|
|
265
285
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
266
286
|
|
|
287
|
+
|
|
267
288
|
```js
|
|
268
289
|
import { CheckboxField } from '@dhis2/ui'
|
|
269
290
|
```
|
|
270
291
|
|
|
292
|
+
|
|
271
293
|
#### Props
|
|
272
294
|
|
|
273
|
-
|
|
|
274
|
-
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
|
|
|
278
|
-
|
|
|
279
|
-
|
|
|
280
|
-
|
|
|
281
|
-
|
|
|
282
|
-
|
|
|
283
|
-
|
|
|
284
|
-
|
|
|
285
|
-
|
|
|
286
|
-
|
|
|
287
|
-
|
|
|
288
|
-
|
|
|
289
|
-
|
|
|
290
|
-
|
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
295
|
+
|Name|Type|Default|Required|Description|
|
|
296
|
+
|---|---|---|---|---|
|
|
297
|
+
|checked|boolean||||
|
|
298
|
+
|className|string||||
|
|
299
|
+
|dataTest|string|`'dhis2-uiwidgets-checkboxfield'`|||
|
|
300
|
+
|dense|boolean|||Smaller dimensions for information-dense layouts|
|
|
301
|
+
|disabled|boolean|||Disables the checkbox|
|
|
302
|
+
|error|custom|||Applies 'error' styling to checkbox and validation text for feedback. Mutually exclusive with `warning` and `valid` props|
|
|
303
|
+
|helpText|string|||Useful instructions for the user|
|
|
304
|
+
|initialFocus|boolean||||
|
|
305
|
+
|label|node|||Labels the checkbox|
|
|
306
|
+
|name|string|||Name associate with the checkbox. Passed in object as argument to event handlers|
|
|
307
|
+
|required|boolean|||Adds an asterisk to indicate this field is required|
|
|
308
|
+
|tabIndex|string||||
|
|
309
|
+
|valid|custom|||Applies 'valid' styling to checkbox and validation text for feedback. Mutually exclusive with `warning` and `error` props|
|
|
310
|
+
|validationText|string|||Adds text below the checkbox to provide validation feedback. Acquires styles from `valid`, `warning` and `error` statuses|
|
|
311
|
+
|value|string|||Value associated with the checkbox. Passed in object as argument to event handlers|
|
|
312
|
+
|warning|custom|||Applies 'warning' styling to checkbox and validation text for feedback. Mutually exclusive with `valid` and `error` props|
|
|
313
|
+
|onBlur|function|||Called with signature `({ name: string, value: string, checked: bool }, event)`|
|
|
314
|
+
|onChange|function|||Called with signature `({ name: string, value: string, checked: bool }, event)`|
|
|
315
|
+
|onFocus|function|||Called with signature `({ name: string, value: string, checked: bool }, event)`|
|
|
294
316
|
|
|
295
317
|
### Chip
|
|
296
318
|
|
|
@@ -298,29 +320,31 @@ import { CheckboxField } from '@dhis2/ui'
|
|
|
298
320
|
|
|
299
321
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
300
322
|
|
|
323
|
+
|
|
301
324
|
```js
|
|
302
325
|
import { Chip } from '@dhis2/ui'
|
|
303
326
|
```
|
|
304
327
|
|
|
328
|
+
|
|
305
329
|
#### Props
|
|
306
330
|
|
|
307
|
-
|
|
|
308
|
-
|
|
309
|
-
|
|
|
310
|
-
|
|
|
311
|
-
|
|
|
312
|
-
|
|
|
313
|
-
|
|
|
314
|
-
|
|
|
315
|
-
|
|
|
316
|
-
|
|
|
317
|
-
|
|
|
318
|
-
|
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
|
|
|
322
|
-
|
|
|
323
|
-
|
|
|
331
|
+
|Name|Type|Default|Required|Description|
|
|
332
|
+
|---|---|---|---|---|
|
|
333
|
+
|children|any||||
|
|
334
|
+
|className|string||||
|
|
335
|
+
|dataTest|string|`'dhis2-uicore-chip'`|||
|
|
336
|
+
|dense|boolean||||
|
|
337
|
+
|disabled|boolean||||
|
|
338
|
+
|dragging|boolean||||
|
|
339
|
+
|icon|element||||
|
|
340
|
+
|marginBottom|number|`4`||`margin-bottom` value, applied in `px`|
|
|
341
|
+
|marginLeft|number|`4`||`margin-left` value, applied in `px`|
|
|
342
|
+
|marginRight|number|`4`||`margin-right` value, applied in `px`|
|
|
343
|
+
|marginTop|number|`4`||`margin-top` value, applied in `px`|
|
|
344
|
+
|overflow|boolean||||
|
|
345
|
+
|selected|boolean||||
|
|
346
|
+
|onClick|function||||
|
|
347
|
+
|onRemove|function||||
|
|
324
348
|
|
|
325
349
|
### Cover
|
|
326
350
|
|
|
@@ -328,19 +352,21 @@ import { Chip } from '@dhis2/ui'
|
|
|
328
352
|
|
|
329
353
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
330
354
|
|
|
355
|
+
|
|
331
356
|
```js
|
|
332
357
|
import { Cover } from '@dhis2/ui'
|
|
333
358
|
```
|
|
334
359
|
|
|
360
|
+
|
|
335
361
|
#### Props
|
|
336
362
|
|
|
337
|
-
|
|
|
338
|
-
|
|
339
|
-
|
|
|
340
|
-
|
|
|
341
|
-
|
|
|
342
|
-
|
|
|
343
|
-
|
|
|
363
|
+
|Name|Type|Default|Required|Description|
|
|
364
|
+
|---|---|---|---|---|
|
|
365
|
+
|children|node||||
|
|
366
|
+
|className|string||||
|
|
367
|
+
|dataTest|string|`'dhis2-uicore-componentcover'`|||
|
|
368
|
+
|translucent|boolean|||Adds a semi-transparent background to the cover|
|
|
369
|
+
|onClick|function||||
|
|
344
370
|
|
|
345
371
|
### CssReset
|
|
346
372
|
|
|
@@ -348,29 +374,34 @@ import { Cover } from '@dhis2/ui'
|
|
|
348
374
|
|
|
349
375
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
350
376
|
|
|
377
|
+
|
|
351
378
|
```js
|
|
352
379
|
import { CssReset } from '@dhis2/ui'
|
|
353
380
|
```
|
|
354
381
|
|
|
382
|
+
|
|
383
|
+
|
|
355
384
|
### CssVariables
|
|
356
385
|
|
|
357
386
|
#### Usage
|
|
358
387
|
|
|
359
388
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
360
389
|
|
|
390
|
+
|
|
361
391
|
```js
|
|
362
392
|
import { CssVariables } from '@dhis2/ui'
|
|
363
393
|
```
|
|
364
394
|
|
|
395
|
+
|
|
365
396
|
#### Props
|
|
366
397
|
|
|
367
|
-
|
|
|
368
|
-
|
|
369
|
-
|
|
|
370
|
-
|
|
|
371
|
-
|
|
|
372
|
-
|
|
|
373
|
-
|
|
|
398
|
+
|Name|Type|Default|Required|Description|
|
|
399
|
+
|---|---|---|---|---|
|
|
400
|
+
|colors|boolean|`false`|||
|
|
401
|
+
|elevations|boolean|`false`|||
|
|
402
|
+
|layers|boolean|`false`|||
|
|
403
|
+
|spacers|boolean|`false`|||
|
|
404
|
+
|theme|boolean|`false`|||
|
|
374
405
|
|
|
375
406
|
### Divider
|
|
376
407
|
|
|
@@ -378,18 +409,20 @@ import { CssVariables } from '@dhis2/ui'
|
|
|
378
409
|
|
|
379
410
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
380
411
|
|
|
412
|
+
|
|
381
413
|
```js
|
|
382
414
|
import { Divider } from '@dhis2/ui'
|
|
383
415
|
```
|
|
384
416
|
|
|
417
|
+
|
|
385
418
|
#### Props
|
|
386
419
|
|
|
387
|
-
|
|
|
388
|
-
|
|
389
|
-
|
|
|
390
|
-
|
|
|
391
|
-
|
|
|
392
|
-
|
|
|
420
|
+
|Name|Type|Default|Required|Description|
|
|
421
|
+
|---|---|---|---|---|
|
|
422
|
+
|className|string||||
|
|
423
|
+
|dataTest|string|`'dhis2-uicore-divider'`|||
|
|
424
|
+
|dense|boolean||||
|
|
425
|
+
|margin|string|``${spacers.dp8} 0``|||
|
|
393
426
|
|
|
394
427
|
### Field
|
|
395
428
|
|
|
@@ -397,26 +430,28 @@ import { Divider } from '@dhis2/ui'
|
|
|
397
430
|
|
|
398
431
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
399
432
|
|
|
433
|
+
|
|
400
434
|
```js
|
|
401
435
|
import { Field } from '@dhis2/ui'
|
|
402
436
|
```
|
|
403
437
|
|
|
438
|
+
|
|
404
439
|
#### Props
|
|
405
440
|
|
|
406
|
-
|
|
|
407
|
-
|
|
408
|
-
|
|
|
409
|
-
|
|
|
410
|
-
|
|
|
411
|
-
|
|
|
412
|
-
|
|
|
413
|
-
|
|
|
414
|
-
|
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
|
419
|
-
|
|
|
441
|
+
|Name|Type|Default|Required|Description|
|
|
442
|
+
|---|---|---|---|---|
|
|
443
|
+
|children|node||||
|
|
444
|
+
|className|string||||
|
|
445
|
+
|dataTest|string|`'dhis2-uicore-field'`|||
|
|
446
|
+
|disabled|boolean|||Disabled status, shown when mouse is over label|
|
|
447
|
+
|error|custom|||Field status. Mutually exclusive with `valid` and `warning` props|
|
|
448
|
+
|helpText|string|||Useful text within the field|
|
|
449
|
+
|label|string|||Label at the top of the field|
|
|
450
|
+
|name|string|||`name` will become the target of the `for`/`htmlFor` attribute on the `<label>` element|
|
|
451
|
+
|required|boolean|||Inidcates this field is required|
|
|
452
|
+
|valid|custom|||Field status. Mutually exclusive with `error` and `warning` props|
|
|
453
|
+
|validationText|string|||Feedback given related to validation status of field|
|
|
454
|
+
|warning|custom|||Field status. Mutually exclusive with `valid` and `error` props|
|
|
420
455
|
|
|
421
456
|
### FieldGroup
|
|
422
457
|
|
|
@@ -424,26 +459,28 @@ import { Field } from '@dhis2/ui'
|
|
|
424
459
|
|
|
425
460
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
426
461
|
|
|
462
|
+
|
|
427
463
|
```js
|
|
428
464
|
import { FieldGroup } from '@dhis2/ui'
|
|
429
465
|
```
|
|
430
466
|
|
|
467
|
+
|
|
431
468
|
#### Props
|
|
432
469
|
|
|
433
|
-
|
|
|
434
|
-
|
|
435
|
-
|
|
|
436
|
-
|
|
|
437
|
-
|
|
|
438
|
-
|
|
|
439
|
-
|
|
|
440
|
-
|
|
|
441
|
-
|
|
|
442
|
-
|
|
|
443
|
-
|
|
|
444
|
-
|
|
|
445
|
-
|
|
|
446
|
-
|
|
|
470
|
+
|Name|Type|Default|Required|Description|
|
|
471
|
+
|---|---|---|---|---|
|
|
472
|
+
|children|node||||
|
|
473
|
+
|className|string||||
|
|
474
|
+
|dataTest|string|`'dhis2-uiwidgets-fieldsetfield'`|||
|
|
475
|
+
|disabled|boolean|||Disables the form controls within|
|
|
476
|
+
|error|custom|||Applies 'error' styling to validation text for feedback. Mutually exclusive with `warning` and `valid` props|
|
|
477
|
+
|helpText|string|||Useful instructions for the user|
|
|
478
|
+
|label|string|||Labels the Field Group|
|
|
479
|
+
|name|string|||Name associate with the Field Group. Passed in object as argument to event handlers|
|
|
480
|
+
|required|boolean|||Adds an asterisk to indicate this field is required|
|
|
481
|
+
|valid|custom|||Applies 'valid' styling to validation text for feedback. Mutually exclusive with `warning` and `error` props|
|
|
482
|
+
|validationText|string|||Adds text at the bottom of the field to provide validation feedback. Acquires styles from `valid`, `warning` and `error` statuses|
|
|
483
|
+
|warning|custom|||Applies 'warning' styling to validation text for feedback. Mutually exclusive with `valid` and `error` props|
|
|
447
484
|
|
|
448
485
|
### FieldSet
|
|
449
486
|
|
|
@@ -451,17 +488,19 @@ import { FieldGroup } from '@dhis2/ui'
|
|
|
451
488
|
|
|
452
489
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
453
490
|
|
|
491
|
+
|
|
454
492
|
```js
|
|
455
493
|
import { FieldSet } from '@dhis2/ui'
|
|
456
494
|
```
|
|
457
495
|
|
|
496
|
+
|
|
458
497
|
#### Props
|
|
459
498
|
|
|
460
|
-
|
|
|
461
|
-
|
|
462
|
-
|
|
|
463
|
-
|
|
|
464
|
-
|
|
|
499
|
+
|Name|Type|Default|Required|Description|
|
|
500
|
+
|---|---|---|---|---|
|
|
501
|
+
|children|node||||
|
|
502
|
+
|className|string||||
|
|
503
|
+
|dataTest|string|`'dhis2-uicore-fieldset'`|||
|
|
465
504
|
|
|
466
505
|
### FileInput
|
|
467
506
|
|
|
@@ -469,31 +508,33 @@ import { FieldSet } from '@dhis2/ui'
|
|
|
469
508
|
|
|
470
509
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
471
510
|
|
|
511
|
+
|
|
472
512
|
```js
|
|
473
513
|
import { FileInput } from '@dhis2/ui'
|
|
474
514
|
```
|
|
475
515
|
|
|
516
|
+
|
|
476
517
|
#### Props
|
|
477
518
|
|
|
478
|
-
|
|
|
479
|
-
|
|
480
|
-
|
|
|
481
|
-
|
|
|
482
|
-
|
|
|
483
|
-
|
|
|
484
|
-
|
|
|
485
|
-
|
|
|
486
|
-
|
|
|
487
|
-
|
|
|
488
|
-
|
|
|
489
|
-
|
|
|
490
|
-
|
|
|
491
|
-
|
|
|
492
|
-
|
|
|
493
|
-
|
|
|
494
|
-
|
|
|
495
|
-
|
|
|
496
|
-
|
|
|
519
|
+
|Name|Type|Default|Required|Description|
|
|
520
|
+
|---|---|---|---|---|
|
|
521
|
+
|accept|string|`'*'`||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|
|
522
|
+
|buttonLabel|string||||
|
|
523
|
+
|className|string||||
|
|
524
|
+
|dataTest|string|`'dhis2-uicore-fileinput'`|||
|
|
525
|
+
|disabled|boolean||||
|
|
526
|
+
|error|custom|||Input status. Mutually exclusive with `warning` and `valid`|
|
|
527
|
+
|initialFocus|boolean||||
|
|
528
|
+
|large|custom|||Button size. Mutually exclusive with `small`|
|
|
529
|
+
|multiple|boolean|||The `multiple` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#multiple)|
|
|
530
|
+
|name|string||||
|
|
531
|
+
|small|custom|||Button size. Mutually exclusive with `large`|
|
|
532
|
+
|tabIndex|string||||
|
|
533
|
+
|valid|custom|||Input status. Mutually exclusive with `warning` and `error`|
|
|
534
|
+
|warning|custom|||Input status. Mutually exclusive with `valid` and `error`|
|
|
535
|
+
|onBlur|function|||Called with signature `(object, event)`|
|
|
536
|
+
|onChange|function|||Called with signature `(object, event)`|
|
|
537
|
+
|onFocus|function|||Called with signature `(object, event)`|
|
|
497
538
|
|
|
498
539
|
### FileInputField
|
|
499
540
|
|
|
@@ -501,37 +542,39 @@ import { FileInput } from '@dhis2/ui'
|
|
|
501
542
|
|
|
502
543
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
503
544
|
|
|
545
|
+
|
|
504
546
|
```js
|
|
505
547
|
import { FileInputField } from '@dhis2/ui'
|
|
506
548
|
```
|
|
507
549
|
|
|
550
|
+
|
|
508
551
|
#### Props
|
|
509
552
|
|
|
510
|
-
|
|
|
511
|
-
|
|
512
|
-
|
|
|
513
|
-
|
|
|
514
|
-
|
|
|
515
|
-
|
|
|
516
|
-
|
|
|
517
|
-
|
|
|
518
|
-
|
|
|
519
|
-
|
|
|
520
|
-
|
|
|
521
|
-
|
|
|
522
|
-
|
|
|
523
|
-
|
|
|
524
|
-
|
|
|
525
|
-
|
|
|
526
|
-
|
|
|
527
|
-
|
|
|
528
|
-
|
|
|
529
|
-
|
|
|
530
|
-
|
|
|
531
|
-
|
|
|
532
|
-
|
|
|
533
|
-
|
|
|
534
|
-
|
|
|
553
|
+
|Name|Type|Default|Required|Description|
|
|
554
|
+
|---|---|---|---|---|
|
|
555
|
+
|accept|string|`'*'`||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|
|
556
|
+
|buttonLabel|string │ function|`() => i18n.t('Upload a file')`||Text on the button|
|
|
557
|
+
|children|node||||
|
|
558
|
+
|className|string||||
|
|
559
|
+
|dataTest|string|`'dhis2-uiwidgets-fileinputfield'`|||
|
|
560
|
+
|disabled|boolean|||Disables the button|
|
|
561
|
+
|error|custom|||Applies 'error' styling to the validation text. Mutually exclusive with `warning` and `valid` props|
|
|
562
|
+
|helpText|string|||Useful guiding text for the user|
|
|
563
|
+
|initialFocus|boolean||||
|
|
564
|
+
|label|string|||A descriptive label above the button|
|
|
565
|
+
|large|custom|||Size of the button. Mutually exclusive with the `small` prop|
|
|
566
|
+
|multiple|boolean|||The `multiple` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#multiple)|
|
|
567
|
+
|name|string|||Name associated with input. Passed to event handler callbacks|
|
|
568
|
+
|placeholder|string │ function|`() => i18n.t('No file uploaded yet')`||Placeholder below the button|
|
|
569
|
+
|required|boolean|||Adds an asterisk to indicate this field is required|
|
|
570
|
+
|small|custom|||Size of the button. Mutually exclusive with the `large` prop|
|
|
571
|
+
|tabIndex|string||||
|
|
572
|
+
|valid|custom|||Applies 'valid' styling to the validation text. Mutually exclusive with `warning` and `error` props|
|
|
573
|
+
|validationText|string|||Text below the button that provides validation feedback|
|
|
574
|
+
|warning|custom|||Applies 'warning' styling to the validation text. Mutually exclusive with `valid` and `error` props|
|
|
575
|
+
|onBlur|function||||
|
|
576
|
+
|onChange|function|||Called with signature `({ name: string, files: [] }, event)`|
|
|
577
|
+
|onFocus|function||||
|
|
535
578
|
|
|
536
579
|
### FileListItem
|
|
537
580
|
|
|
@@ -539,22 +582,24 @@ import { FileInputField } from '@dhis2/ui'
|
|
|
539
582
|
|
|
540
583
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
541
584
|
|
|
585
|
+
|
|
542
586
|
```js
|
|
543
587
|
import { FileListItem } from '@dhis2/ui'
|
|
544
588
|
```
|
|
545
589
|
|
|
590
|
+
|
|
546
591
|
#### Props
|
|
547
592
|
|
|
548
|
-
|
|
|
549
|
-
|
|
550
|
-
|
|
|
551
|
-
|
|
|
552
|
-
|
|
|
553
|
-
|
|
|
554
|
-
|
|
|
555
|
-
|
|
|
556
|
-
|
|
|
557
|
-
|
|
|
593
|
+
|Name|Type|Default|Required|Description|
|
|
594
|
+
|---|---|---|---|---|
|
|
595
|
+
|onRemove|function||*||
|
|
596
|
+
|cancelText|string||||
|
|
597
|
+
|className|string||||
|
|
598
|
+
|dataTest|string|`'dhis2-uicore-filelistitem'`|||
|
|
599
|
+
|label|string||||
|
|
600
|
+
|loading|boolean||||
|
|
601
|
+
|removeText|string||||
|
|
602
|
+
|onCancel|function||||
|
|
558
603
|
|
|
559
604
|
### FileListPlaceholder
|
|
560
605
|
|
|
@@ -562,16 +607,18 @@ import { FileListItem } from '@dhis2/ui'
|
|
|
562
607
|
|
|
563
608
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
564
609
|
|
|
610
|
+
|
|
565
611
|
```js
|
|
566
612
|
import { FileListPlaceholder } from '@dhis2/ui'
|
|
567
613
|
```
|
|
568
614
|
|
|
615
|
+
|
|
569
616
|
#### Props
|
|
570
617
|
|
|
571
|
-
|
|
|
572
|
-
|
|
573
|
-
|
|
|
574
|
-
|
|
|
618
|
+
|Name|Type|Default|Required|Description|
|
|
619
|
+
|---|---|---|---|---|
|
|
620
|
+
|children|string||||
|
|
621
|
+
|dataTest|string|`'dhis2-uicore-filelistplaceholder'`|||
|
|
575
622
|
|
|
576
623
|
### FileList
|
|
577
624
|
|
|
@@ -579,17 +626,19 @@ import { FileListPlaceholder } from '@dhis2/ui'
|
|
|
579
626
|
|
|
580
627
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
581
628
|
|
|
629
|
+
|
|
582
630
|
```js
|
|
583
631
|
import { FileList } from '@dhis2/ui'
|
|
584
632
|
```
|
|
585
633
|
|
|
634
|
+
|
|
586
635
|
#### Props
|
|
587
636
|
|
|
588
|
-
|
|
|
589
|
-
|
|
590
|
-
|
|
|
591
|
-
|
|
|
592
|
-
|
|
|
637
|
+
|Name|Type|Default|Required|Description|
|
|
638
|
+
|---|---|---|---|---|
|
|
639
|
+
|children|node||||
|
|
640
|
+
|className|string||||
|
|
641
|
+
|dataTest|string|`'dhis2-uicore-filelist'`|||
|
|
593
642
|
|
|
594
643
|
### HeaderBar
|
|
595
644
|
|
|
@@ -597,16 +646,18 @@ import { FileList } from '@dhis2/ui'
|
|
|
597
646
|
|
|
598
647
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
599
648
|
|
|
649
|
+
|
|
600
650
|
```js
|
|
601
651
|
import { HeaderBar } from '@dhis2/ui'
|
|
602
652
|
```
|
|
603
653
|
|
|
654
|
+
|
|
604
655
|
#### Props
|
|
605
656
|
|
|
606
|
-
|
|
|
607
|
-
|
|
608
|
-
|
|
|
609
|
-
|
|
|
657
|
+
|Name|Type|Default|Required|Description|
|
|
658
|
+
|---|---|---|---|---|
|
|
659
|
+
|appName|string||||
|
|
660
|
+
|className|string||||
|
|
610
661
|
|
|
611
662
|
### Logo
|
|
612
663
|
|
|
@@ -614,30 +665,35 @@ import { HeaderBar } from '@dhis2/ui'
|
|
|
614
665
|
|
|
615
666
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
616
667
|
|
|
668
|
+
|
|
617
669
|
```js
|
|
618
670
|
import { Logo } from '@dhis2/ui'
|
|
619
671
|
```
|
|
620
672
|
|
|
673
|
+
|
|
674
|
+
|
|
621
675
|
### Help
|
|
622
676
|
|
|
623
677
|
#### Usage
|
|
624
678
|
|
|
625
679
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
626
680
|
|
|
681
|
+
|
|
627
682
|
```js
|
|
628
683
|
import { Help } from '@dhis2/ui'
|
|
629
684
|
```
|
|
630
685
|
|
|
686
|
+
|
|
631
687
|
#### Props
|
|
632
688
|
|
|
633
|
-
|
|
|
634
|
-
|
|
635
|
-
|
|
|
636
|
-
|
|
|
637
|
-
|
|
|
638
|
-
|
|
|
639
|
-
|
|
|
640
|
-
|
|
|
689
|
+
|Name|Type|Default|Required|Description|
|
|
690
|
+
|---|---|---|---|---|
|
|
691
|
+
|children|string||||
|
|
692
|
+
|className|string||||
|
|
693
|
+
|dataTest|string|`'dhis2-uicore-help'`|||
|
|
694
|
+
|error|custom||||
|
|
695
|
+
|valid|custom||||
|
|
696
|
+
|warning|custom||||
|
|
641
697
|
|
|
642
698
|
### Input
|
|
643
699
|
|
|
@@ -645,37 +701,39 @@ import { Help } from '@dhis2/ui'
|
|
|
645
701
|
|
|
646
702
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
647
703
|
|
|
704
|
+
|
|
648
705
|
```js
|
|
649
706
|
import { Input } from '@dhis2/ui'
|
|
650
707
|
```
|
|
651
708
|
|
|
709
|
+
|
|
652
710
|
#### Props
|
|
653
711
|
|
|
654
|
-
|
|
|
655
|
-
|
|
656
|
-
|
|
|
657
|
-
|
|
|
658
|
-
|
|
|
659
|
-
|
|
|
660
|
-
|
|
|
661
|
-
|
|
|
662
|
-
|
|
|
663
|
-
|
|
|
664
|
-
|
|
|
665
|
-
|
|
|
666
|
-
|
|
|
667
|
-
|
|
|
668
|
-
|
|
|
669
|
-
|
|
|
670
|
-
|
|
|
671
|
-
|
|
|
672
|
-
|
|
|
673
|
-
|
|
|
674
|
-
|
|
|
675
|
-
|
|
|
676
|
-
|
|
|
677
|
-
|
|
|
678
|
-
|
|
|
712
|
+
|Name|Type|Default|Required|Description|
|
|
713
|
+
|---|---|---|---|---|
|
|
714
|
+
|autoComplete|string|||The [native `autocomplete` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete)|
|
|
715
|
+
|className|string||||
|
|
716
|
+
|dataTest|string|`'dhis2-uicore-input'`|||
|
|
717
|
+
|dense|boolean|||Makes the input smaller|
|
|
718
|
+
|disabled|boolean|||Disables the input|
|
|
719
|
+
|error|custom|||Applies 'error' appearance for validation feedback. Mutually exclusive with `valid` and `warning` props|
|
|
720
|
+
|initialFocus|boolean|||The input grabs initial focus on the page|
|
|
721
|
+
|loading|boolean|||Adds a loading indicator beside the input|
|
|
722
|
+
|max|string|||The [native `max` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max), for use when `type` is `'number'`|
|
|
723
|
+
|min|string|||The [native `min` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min), for use when `type` is `'number'`|
|
|
724
|
+
|name|string|||Name associated with the input. Passed to event handler callbacks in object|
|
|
725
|
+
|placeholder|string|||Placeholder text for the input|
|
|
726
|
+
|readOnly|boolean|||Makes the input read-only|
|
|
727
|
+
|role|string|||Sets a role attribute on the input|
|
|
728
|
+
|step|string|||The [native `step` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step), for use when `type` is `'number'`|
|
|
729
|
+
|tabIndex|string||||
|
|
730
|
+
|type|'text' │ 'number' │ 'password' │ 'email' │ 'url' │ 'tel' │ 'date' │ 'datetime' │ 'datetime-local' │ 'month' │ 'week' │ 'time' │ 'search'|`'text'`||The native input `type` attribute|
|
|
731
|
+
|valid|custom|||Applies 'valid' appearance for validation feedback. Mutually exclusive with `error` and `warning` props|
|
|
732
|
+
|value|string|||Value in the input. Can be used to control the component (recommended). Passed to event handler callbacks in object|
|
|
733
|
+
|warning|custom|||Applies 'warning' appearance for validation feedback. Mutually exclusive with `valid` and `error` props|
|
|
734
|
+
|onBlur|function|||Called with signature `({ name: string, value: string }, event)`|
|
|
735
|
+
|onChange|function|||Called with signature `({ name: string, value: string }, event)`|
|
|
736
|
+
|onFocus|function|||Called with signature `({ name: string, value: string }, event)`|
|
|
679
737
|
|
|
680
738
|
### InputField
|
|
681
739
|
|
|
@@ -683,41 +741,43 @@ import { Input } from '@dhis2/ui'
|
|
|
683
741
|
|
|
684
742
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
685
743
|
|
|
744
|
+
|
|
686
745
|
```js
|
|
687
746
|
import { InputField } from '@dhis2/ui'
|
|
688
747
|
```
|
|
689
748
|
|
|
749
|
+
|
|
690
750
|
#### Props
|
|
691
751
|
|
|
692
|
-
|
|
|
693
|
-
|
|
694
|
-
|
|
|
695
|
-
|
|
|
696
|
-
|
|
|
697
|
-
|
|
|
698
|
-
|
|
|
699
|
-
|
|
|
700
|
-
|
|
|
701
|
-
|
|
|
702
|
-
|
|
|
703
|
-
|
|
|
704
|
-
|
|
|
705
|
-
|
|
|
706
|
-
|
|
|
707
|
-
|
|
|
708
|
-
|
|
|
709
|
-
|
|
|
710
|
-
|
|
|
711
|
-
|
|
|
712
|
-
|
|
|
713
|
-
|
|
|
714
|
-
|
|
|
715
|
-
|
|
|
716
|
-
|
|
|
717
|
-
|
|
|
718
|
-
|
|
|
719
|
-
|
|
|
720
|
-
|
|
|
752
|
+
|Name|Type|Default|Required|Description|
|
|
753
|
+
|---|---|---|---|---|
|
|
754
|
+
|autoComplete|string|||The [native `autocomplete` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete)|
|
|
755
|
+
|className|string||||
|
|
756
|
+
|dataTest|string|`'dhis2-uiwidgets-inputfield'`|||
|
|
757
|
+
|dense|boolean|||Makes the input smaller|
|
|
758
|
+
|disabled|boolean|||Disables the input|
|
|
759
|
+
|error|custom|||Applies 'error' appearance for validation feedback. Mutually exclusive with `valid` and `warning` props|
|
|
760
|
+
|helpText|string|||Guiding text for how to use this input|
|
|
761
|
+
|initialFocus|boolean|||The input grabs initial focus on the page|
|
|
762
|
+
|inputWidth|string|||Defines the width of the input. Can be any valid CSS measurement|
|
|
763
|
+
|label|string|||Label text for the input|
|
|
764
|
+
|loading|boolean|||Adds a loading indicator beside the input|
|
|
765
|
+
|max|string|||The [native `max` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max), for use when `type` is `'number'`|
|
|
766
|
+
|min|string|||The [native `min` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min), for use when `type` is `'number'`|
|
|
767
|
+
|name|string|||Name associated with the input. Passed to event handler callbacks in object|
|
|
768
|
+
|placeholder|string|||Placeholder text for the input|
|
|
769
|
+
|readOnly|boolean|||Makes the input read-only|
|
|
770
|
+
|required|boolean|||Indicates this input is required|
|
|
771
|
+
|step|string|||The [native `step` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step), for use when `type` is `'number'`|
|
|
772
|
+
|tabIndex|string||||
|
|
773
|
+
|type|custom|||Type of input|
|
|
774
|
+
|valid|custom|||Applies 'valid' appearance for validation feedback. Mutually exclusive with `error` and `warning` props|
|
|
775
|
+
|validationText|string|||Text below input for validation feedback. Receives styles depending on validation status|
|
|
776
|
+
|value|string|||Value in the input. Can be used to control the component (recommended). Passed to event handler callbacks in object|
|
|
777
|
+
|warning|custom|||Applies 'warning' appearance for validation feedback. Mutually exclusive with `valid` and `error` props|
|
|
778
|
+
|onBlur|function|||Called with signature `({ name: string, value: string }, event)`|
|
|
779
|
+
|onChange|function|||Called with signature `({ name: string, value: string }, event)`|
|
|
780
|
+
|onFocus|function|||Called with signature `({ name: string, value: string }, event)`|
|
|
721
781
|
|
|
722
782
|
### IntersectionDetector
|
|
723
783
|
|
|
@@ -725,20 +785,22 @@ import { InputField } from '@dhis2/ui'
|
|
|
725
785
|
|
|
726
786
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
727
787
|
|
|
788
|
+
|
|
728
789
|
```js
|
|
729
790
|
import { IntersectionDetector } from '@dhis2/ui'
|
|
730
791
|
```
|
|
731
792
|
|
|
793
|
+
|
|
732
794
|
#### Props
|
|
733
795
|
|
|
734
|
-
|
|
|
735
|
-
|
|
736
|
-
|
|
|
737
|
-
|
|
|
738
|
-
|
|
|
739
|
-
|
|
|
740
|
-
|
|
|
741
|
-
|
|
|
796
|
+
|Name|Type|Default|Required|Description|
|
|
797
|
+
|---|---|---|---|---|
|
|
798
|
+
|rootRef|{<br/> "current": "instanceOf(HTMLElement)"<br/>}||*|React ref on other component to detect intersections with|
|
|
799
|
+
|onChange|function||*|Called with signature `({ isIntersecting: bool })`|
|
|
800
|
+
|children|any||||
|
|
801
|
+
|className|string||||
|
|
802
|
+
|dataTest|string|`'dhis2-uicore-intersectiondetector'`|||
|
|
803
|
+
|threshold|number|`0`||The [threshold](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#Intersection_observer_options) value: a value from 0.0 to 1.0 that controls the point at which an intersecting component is considered 'intersected' or 'visible' and the onChange callback triggers|
|
|
742
804
|
|
|
743
805
|
### Label
|
|
744
806
|
|
|
@@ -746,20 +808,22 @@ import { IntersectionDetector } from '@dhis2/ui'
|
|
|
746
808
|
|
|
747
809
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
748
810
|
|
|
811
|
+
|
|
749
812
|
```js
|
|
750
813
|
import { Label } from '@dhis2/ui'
|
|
751
814
|
```
|
|
752
815
|
|
|
816
|
+
|
|
753
817
|
#### Props
|
|
754
818
|
|
|
755
|
-
|
|
|
756
|
-
|
|
757
|
-
|
|
|
758
|
-
|
|
|
759
|
-
|
|
|
760
|
-
|
|
|
761
|
-
|
|
|
762
|
-
|
|
|
819
|
+
|Name|Type|Default|Required|Description|
|
|
820
|
+
|---|---|---|---|---|
|
|
821
|
+
|children|string||||
|
|
822
|
+
|className|string||||
|
|
823
|
+
|dataTest|string|`'dhis2-uicore-label'`|||
|
|
824
|
+
|disabled|boolean||||
|
|
825
|
+
|htmlFor|string||||
|
|
826
|
+
|required|boolean||||
|
|
763
827
|
|
|
764
828
|
### Layer
|
|
765
829
|
|
|
@@ -767,22 +831,25 @@ import { Label } from '@dhis2/ui'
|
|
|
767
831
|
|
|
768
832
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
769
833
|
|
|
834
|
+
|
|
770
835
|
```js
|
|
771
836
|
import { Layer } from '@dhis2/ui'
|
|
772
837
|
```
|
|
773
838
|
|
|
839
|
+
|
|
774
840
|
#### Props
|
|
775
841
|
|
|
776
|
-
|
|
|
777
|
-
|
|
778
|
-
|
|
|
779
|
-
|
|
|
780
|
-
|
|
|
781
|
-
|
|
|
782
|
-
|
|
|
783
|
-
|
|
|
784
|
-
|
|
|
785
|
-
|
|
|
842
|
+
|Name|Type|Default|Required|Description|
|
|
843
|
+
|---|---|---|---|---|
|
|
844
|
+
|children|node||||
|
|
845
|
+
|className|string||||
|
|
846
|
+
|dataTest|string|`'dhis2-uicore-layer'`|||
|
|
847
|
+
|disablePortal|boolean|||Disable the Portal, useful for nesting layers|
|
|
848
|
+
|level|number │ string|`'auto'`||Z-index level|
|
|
849
|
+
|position|'absolute' │ 'fixed'|`'fixed'`|||
|
|
850
|
+
|translucent|boolean|||Adds a semi-transparent background|
|
|
851
|
+
|onBackdropClick|function|||Backdrop click handler|
|
|
852
|
+
|onClick|custom|||Click handler - DEPRECATED|
|
|
786
853
|
|
|
787
854
|
### Legend
|
|
788
855
|
|
|
@@ -790,18 +857,20 @@ import { Layer } from '@dhis2/ui'
|
|
|
790
857
|
|
|
791
858
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
792
859
|
|
|
860
|
+
|
|
793
861
|
```js
|
|
794
862
|
import { Legend } from '@dhis2/ui'
|
|
795
863
|
```
|
|
796
864
|
|
|
865
|
+
|
|
797
866
|
#### Props
|
|
798
867
|
|
|
799
|
-
|
|
|
800
|
-
|
|
801
|
-
|
|
|
802
|
-
|
|
|
803
|
-
|
|
|
804
|
-
|
|
|
868
|
+
|Name|Type|Default|Required|Description|
|
|
869
|
+
|---|---|---|---|---|
|
|
870
|
+
|children|node||||
|
|
871
|
+
|className|string||||
|
|
872
|
+
|dataTest|string|`'dhis2-uicore-legend'`|||
|
|
873
|
+
|required|boolean|||Indicates the associated field set is required|
|
|
805
874
|
|
|
806
875
|
### CircularLoader
|
|
807
876
|
|
|
@@ -809,20 +878,22 @@ import { Legend } from '@dhis2/ui'
|
|
|
809
878
|
|
|
810
879
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
811
880
|
|
|
881
|
+
|
|
812
882
|
```js
|
|
813
883
|
import { CircularLoader } from '@dhis2/ui'
|
|
814
884
|
```
|
|
815
885
|
|
|
886
|
+
|
|
816
887
|
#### Props
|
|
817
888
|
|
|
818
|
-
|
|
|
819
|
-
|
|
820
|
-
|
|
|
821
|
-
|
|
|
822
|
-
|
|
|
823
|
-
|
|
|
824
|
-
|
|
|
825
|
-
|
|
|
889
|
+
|Name|Type|Default|Required|Description|
|
|
890
|
+
|---|---|---|---|---|
|
|
891
|
+
|className|string||||
|
|
892
|
+
|dataTest|string|`'dhis2-uicore-circularloader'`|||
|
|
893
|
+
|extrasmall|custom||||
|
|
894
|
+
|invert|boolean||||
|
|
895
|
+
|large|custom||||
|
|
896
|
+
|small|custom||||
|
|
826
897
|
|
|
827
898
|
### LinearLoader
|
|
828
899
|
|
|
@@ -830,20 +901,22 @@ import { CircularLoader } from '@dhis2/ui'
|
|
|
830
901
|
|
|
831
902
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
832
903
|
|
|
904
|
+
|
|
833
905
|
```js
|
|
834
906
|
import { LinearLoader } from '@dhis2/ui'
|
|
835
907
|
```
|
|
836
908
|
|
|
909
|
+
|
|
837
910
|
#### Props
|
|
838
911
|
|
|
839
|
-
|
|
|
840
|
-
|
|
841
|
-
|
|
|
842
|
-
|
|
|
843
|
-
|
|
|
844
|
-
|
|
|
845
|
-
|
|
|
846
|
-
|
|
|
912
|
+
|Name|Type|Default|Required|Description|
|
|
913
|
+
|---|---|---|---|---|
|
|
914
|
+
|amount|number||*|The progression in percent without the '%' sign|
|
|
915
|
+
|className|string||||
|
|
916
|
+
|dataTest|string|`'dhis2-uicore-linearloader'`|||
|
|
917
|
+
|invert|boolean|||Use inverted color scheme|
|
|
918
|
+
|margin|string|`spacers.dp12`||The margin around the loader, can be a full shorthand|
|
|
919
|
+
|width|string|`'300px'`||The width of the entire indicator|
|
|
847
920
|
|
|
848
921
|
### LogoIcon
|
|
849
922
|
|
|
@@ -851,16 +924,18 @@ import { LinearLoader } from '@dhis2/ui'
|
|
|
851
924
|
|
|
852
925
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
853
926
|
|
|
927
|
+
|
|
854
928
|
```js
|
|
855
929
|
import { LogoIcon } from '@dhis2/ui'
|
|
856
930
|
```
|
|
857
931
|
|
|
932
|
+
|
|
858
933
|
#### Props
|
|
859
934
|
|
|
860
|
-
|
|
|
861
|
-
|
|
862
|
-
|
|
|
863
|
-
|
|
|
935
|
+
|Name|Type|Default|Required|Description|
|
|
936
|
+
|---|---|---|---|---|
|
|
937
|
+
|className|string||||
|
|
938
|
+
|dataTest|string|`'dhis2-uicore-logoicon'`|||
|
|
864
939
|
|
|
865
940
|
### LogoIconWhite
|
|
866
941
|
|
|
@@ -868,16 +943,18 @@ import { LogoIcon } from '@dhis2/ui'
|
|
|
868
943
|
|
|
869
944
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
870
945
|
|
|
946
|
+
|
|
871
947
|
```js
|
|
872
948
|
import { LogoIconWhite } from '@dhis2/ui'
|
|
873
949
|
```
|
|
874
950
|
|
|
951
|
+
|
|
875
952
|
#### Props
|
|
876
953
|
|
|
877
|
-
|
|
|
878
|
-
|
|
879
|
-
|
|
|
880
|
-
|
|
|
954
|
+
|Name|Type|Default|Required|Description|
|
|
955
|
+
|---|---|---|---|---|
|
|
956
|
+
|className|string||||
|
|
957
|
+
|dataTest|string|`'dhis2-uicore-logoiconwhite'`|||
|
|
881
958
|
|
|
882
959
|
### Logo
|
|
883
960
|
|
|
@@ -885,16 +962,18 @@ import { LogoIconWhite } from '@dhis2/ui'
|
|
|
885
962
|
|
|
886
963
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
887
964
|
|
|
965
|
+
|
|
888
966
|
```js
|
|
889
967
|
import { Logo } from '@dhis2/ui'
|
|
890
968
|
```
|
|
891
969
|
|
|
970
|
+
|
|
892
971
|
#### Props
|
|
893
972
|
|
|
894
|
-
|
|
|
895
|
-
|
|
896
|
-
|
|
|
897
|
-
|
|
|
973
|
+
|Name|Type|Default|Required|Description|
|
|
974
|
+
|---|---|---|---|---|
|
|
975
|
+
|className|string||||
|
|
976
|
+
|dataTest|string|`'dhis2-uicore-logo'`|||
|
|
898
977
|
|
|
899
978
|
### LogoWhite
|
|
900
979
|
|
|
@@ -902,16 +981,18 @@ import { Logo } from '@dhis2/ui'
|
|
|
902
981
|
|
|
903
982
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
904
983
|
|
|
984
|
+
|
|
905
985
|
```js
|
|
906
986
|
import { LogoWhite } from '@dhis2/ui'
|
|
907
987
|
```
|
|
908
988
|
|
|
989
|
+
|
|
909
990
|
#### Props
|
|
910
991
|
|
|
911
|
-
|
|
|
912
|
-
|
|
913
|
-
|
|
|
914
|
-
|
|
|
992
|
+
|Name|Type|Default|Required|Description|
|
|
993
|
+
|---|---|---|---|---|
|
|
994
|
+
|className|string||||
|
|
995
|
+
|dataTest|string|`'dhis2-uicore-logowhite'`|||
|
|
915
996
|
|
|
916
997
|
### FlyoutMenu
|
|
917
998
|
|
|
@@ -919,20 +1000,22 @@ import { LogoWhite } from '@dhis2/ui'
|
|
|
919
1000
|
|
|
920
1001
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
921
1002
|
|
|
1003
|
+
|
|
922
1004
|
```js
|
|
923
1005
|
import { FlyoutMenu } from '@dhis2/ui'
|
|
924
1006
|
```
|
|
925
1007
|
|
|
1008
|
+
|
|
926
1009
|
#### Props
|
|
927
1010
|
|
|
928
|
-
|
|
|
929
|
-
|
|
930
|
-
|
|
|
931
|
-
|
|
|
932
|
-
|
|
|
933
|
-
|
|
|
934
|
-
|
|
|
935
|
-
|
|
|
1011
|
+
|Name|Type|Default|Required|Description|
|
|
1012
|
+
|---|---|---|---|---|
|
|
1013
|
+
|children|node|||Typically, but not limited to, `MenuItem` components|
|
|
1014
|
+
|className|string||||
|
|
1015
|
+
|dataTest|string|`'dhis2-uicore-menu'`|||
|
|
1016
|
+
|dense|boolean|||Menu uses smaller dimensions|
|
|
1017
|
+
|maxHeight|string|`'auto'`|||
|
|
1018
|
+
|maxWidth|string|`'380px'`|||
|
|
936
1019
|
|
|
937
1020
|
### Menu
|
|
938
1021
|
|
|
@@ -940,18 +1023,20 @@ import { FlyoutMenu } from '@dhis2/ui'
|
|
|
940
1023
|
|
|
941
1024
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
942
1025
|
|
|
1026
|
+
|
|
943
1027
|
```js
|
|
944
1028
|
import { Menu } from '@dhis2/ui'
|
|
945
1029
|
```
|
|
946
1030
|
|
|
1031
|
+
|
|
947
1032
|
#### Props
|
|
948
1033
|
|
|
949
|
-
|
|
|
950
|
-
|
|
951
|
-
|
|
|
952
|
-
|
|
|
953
|
-
|
|
|
954
|
-
|
|
|
1034
|
+
|Name|Type|Default|Required|Description|
|
|
1035
|
+
|---|---|---|---|---|
|
|
1036
|
+
|children|node|||Typically `MenuItem`, `MenuDivider`, and `MenuSectionHeader`|
|
|
1037
|
+
|className|string||||
|
|
1038
|
+
|dataTest|string|`'dhis2-uicore-menulist'`|||
|
|
1039
|
+
|dense|boolean|||Applies `dense` property to all child components unless already specified|
|
|
955
1040
|
|
|
956
1041
|
### MenuDivider
|
|
957
1042
|
|
|
@@ -959,17 +1044,19 @@ import { Menu } from '@dhis2/ui'
|
|
|
959
1044
|
|
|
960
1045
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
961
1046
|
|
|
1047
|
+
|
|
962
1048
|
```js
|
|
963
1049
|
import { MenuDivider } from '@dhis2/ui'
|
|
964
1050
|
```
|
|
965
1051
|
|
|
1052
|
+
|
|
966
1053
|
#### Props
|
|
967
1054
|
|
|
968
|
-
|
|
|
969
|
-
|
|
970
|
-
|
|
|
971
|
-
|
|
|
972
|
-
|
|
|
1055
|
+
|Name|Type|Default|Required|Description|
|
|
1056
|
+
|---|---|---|---|---|
|
|
1057
|
+
|className|string||||
|
|
1058
|
+
|dataTest|string|`'dhis2-uicore-menudivider'`|||
|
|
1059
|
+
|dense|boolean||||
|
|
973
1060
|
|
|
974
1061
|
### MenuItem
|
|
975
1062
|
|
|
@@ -977,30 +1064,32 @@ import { MenuDivider } from '@dhis2/ui'
|
|
|
977
1064
|
|
|
978
1065
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
979
1066
|
|
|
1067
|
+
|
|
980
1068
|
```js
|
|
981
1069
|
import { MenuItem } from '@dhis2/ui'
|
|
982
1070
|
```
|
|
983
1071
|
|
|
1072
|
+
|
|
984
1073
|
#### Props
|
|
985
1074
|
|
|
986
|
-
|
|
|
987
|
-
|
|
988
|
-
|
|
|
989
|
-
|
|
|
990
|
-
|
|
|
991
|
-
|
|
|
992
|
-
|
|
|
993
|
-
|
|
|
994
|
-
|
|
|
995
|
-
|
|
|
996
|
-
|
|
|
997
|
-
|
|
|
998
|
-
|
|
|
999
|
-
|
|
|
1000
|
-
|
|
|
1001
|
-
|
|
|
1002
|
-
|
|
|
1003
|
-
|
|
|
1075
|
+
|Name|Type|Default|Required|Description|
|
|
1076
|
+
|---|---|---|---|---|
|
|
1077
|
+
|active|boolean||||
|
|
1078
|
+
|chevron|boolean||||
|
|
1079
|
+
|children|node|||Nested menu items can become submenus.<br/>See `showSubMenu` and `toggleSubMenu` props, and 'Children' demo|
|
|
1080
|
+
|className|string||||
|
|
1081
|
+
|dataTest|string|`'dhis2-uicore-menuitem'`|||
|
|
1082
|
+
|dense|boolean||||
|
|
1083
|
+
|destructive|boolean||||
|
|
1084
|
+
|disabled|boolean||||
|
|
1085
|
+
|href|string|||For using menu item as a link|
|
|
1086
|
+
|icon|node|||An icon for the left side of the menu item|
|
|
1087
|
+
|label|node|||Text in the menu item|
|
|
1088
|
+
|showSubMenu|boolean|||When true, nested menu items are shown in a Popper|
|
|
1089
|
+
|target|string|||For using menu item as a link|
|
|
1090
|
+
|toggleSubMenu|function|||On click, this function is called (without args)|
|
|
1091
|
+
|value|string|||Value associated with item. Passed as an argument to onClick handler.|
|
|
1092
|
+
|onClick|function|||Click handler called with signature `({ value: string }, event)`|
|
|
1004
1093
|
|
|
1005
1094
|
### MenuSectionHeader
|
|
1006
1095
|
|
|
@@ -1008,19 +1097,21 @@ import { MenuItem } from '@dhis2/ui'
|
|
|
1008
1097
|
|
|
1009
1098
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1010
1099
|
|
|
1100
|
+
|
|
1011
1101
|
```js
|
|
1012
1102
|
import { MenuSectionHeader } from '@dhis2/ui'
|
|
1013
1103
|
```
|
|
1014
1104
|
|
|
1105
|
+
|
|
1015
1106
|
#### Props
|
|
1016
1107
|
|
|
1017
|
-
|
|
|
1018
|
-
|
|
1019
|
-
|
|
|
1020
|
-
|
|
|
1021
|
-
|
|
|
1022
|
-
|
|
|
1023
|
-
|
|
|
1108
|
+
|Name|Type|Default|Required|Description|
|
|
1109
|
+
|---|---|---|---|---|
|
|
1110
|
+
|className|string||||
|
|
1111
|
+
|dataTest|string|`'dhis2-uicore-menusectionheader'`|||
|
|
1112
|
+
|dense|boolean||||
|
|
1113
|
+
|hideDivider|boolean||||
|
|
1114
|
+
|label|node||||
|
|
1024
1115
|
|
|
1025
1116
|
### Modal
|
|
1026
1117
|
|
|
@@ -1028,23 +1119,25 @@ import { MenuSectionHeader } from '@dhis2/ui'
|
|
|
1028
1119
|
|
|
1029
1120
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1030
1121
|
|
|
1122
|
+
|
|
1031
1123
|
```js
|
|
1032
1124
|
import { Modal } from '@dhis2/ui'
|
|
1033
1125
|
```
|
|
1034
1126
|
|
|
1127
|
+
|
|
1035
1128
|
#### Props
|
|
1036
1129
|
|
|
1037
|
-
|
|
|
1038
|
-
|
|
1039
|
-
|
|
|
1040
|
-
|
|
|
1041
|
-
|
|
|
1042
|
-
|
|
|
1043
|
-
|
|
|
1044
|
-
|
|
|
1045
|
-
|
|
|
1046
|
-
|
|
|
1047
|
-
|
|
|
1130
|
+
|Name|Type|Default|Required|Description|
|
|
1131
|
+
|---|---|---|---|---|
|
|
1132
|
+
|children|node||||
|
|
1133
|
+
|className|string||||
|
|
1134
|
+
|dataTest|string|`'dhis2-uicore-modal'`|||
|
|
1135
|
+
|fluid|boolean||||
|
|
1136
|
+
|hide|boolean||||
|
|
1137
|
+
|large|custom||||
|
|
1138
|
+
|position|custom|`'top'`|||
|
|
1139
|
+
|small|custom||||
|
|
1140
|
+
|onClose|function|||Callback used when the Modal closes|
|
|
1048
1141
|
|
|
1049
1142
|
### ModalActions
|
|
1050
1143
|
|
|
@@ -1052,16 +1145,18 @@ import { Modal } from '@dhis2/ui'
|
|
|
1052
1145
|
|
|
1053
1146
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1054
1147
|
|
|
1148
|
+
|
|
1055
1149
|
```js
|
|
1056
1150
|
import { ModalActions } from '@dhis2/ui'
|
|
1057
1151
|
```
|
|
1058
1152
|
|
|
1153
|
+
|
|
1059
1154
|
#### Props
|
|
1060
1155
|
|
|
1061
|
-
|
|
|
1062
|
-
|
|
1063
|
-
|
|
|
1064
|
-
|
|
|
1156
|
+
|Name|Type|Default|Required|Description|
|
|
1157
|
+
|---|---|---|---|---|
|
|
1158
|
+
|children|node||||
|
|
1159
|
+
|dataTest|string|`'dhis2-uicore-modalactions'`|||
|
|
1065
1160
|
|
|
1066
1161
|
### ModalContent
|
|
1067
1162
|
|
|
@@ -1069,17 +1164,19 @@ import { ModalActions } from '@dhis2/ui'
|
|
|
1069
1164
|
|
|
1070
1165
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1071
1166
|
|
|
1167
|
+
|
|
1072
1168
|
```js
|
|
1073
1169
|
import { ModalContent } from '@dhis2/ui'
|
|
1074
1170
|
```
|
|
1075
1171
|
|
|
1172
|
+
|
|
1076
1173
|
#### Props
|
|
1077
1174
|
|
|
1078
|
-
|
|
|
1079
|
-
|
|
1080
|
-
|
|
|
1081
|
-
|
|
|
1082
|
-
|
|
|
1175
|
+
|Name|Type|Default|Required|Description|
|
|
1176
|
+
|---|---|---|---|---|
|
|
1177
|
+
|children|node||||
|
|
1178
|
+
|className|string||||
|
|
1179
|
+
|dataTest|string|`'dhis2-uicore-modalcontent'`|||
|
|
1083
1180
|
|
|
1084
1181
|
### ModalTitle
|
|
1085
1182
|
|
|
@@ -1087,16 +1184,18 @@ import { ModalContent } from '@dhis2/ui'
|
|
|
1087
1184
|
|
|
1088
1185
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1089
1186
|
|
|
1187
|
+
|
|
1090
1188
|
```js
|
|
1091
1189
|
import { ModalTitle } from '@dhis2/ui'
|
|
1092
1190
|
```
|
|
1093
1191
|
|
|
1192
|
+
|
|
1094
1193
|
#### Props
|
|
1095
1194
|
|
|
1096
|
-
|
|
|
1097
|
-
|
|
1098
|
-
|
|
|
1099
|
-
|
|
|
1195
|
+
|Name|Type|Default|Required|Description|
|
|
1196
|
+
|---|---|---|---|---|
|
|
1197
|
+
|children|string||||
|
|
1198
|
+
|dataTest|string|`'dhis2-uicore-modaltitle'`|||
|
|
1100
1199
|
|
|
1101
1200
|
### Node
|
|
1102
1201
|
|
|
@@ -1104,22 +1203,24 @@ import { ModalTitle } from '@dhis2/ui'
|
|
|
1104
1203
|
|
|
1105
1204
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1106
1205
|
|
|
1206
|
+
|
|
1107
1207
|
```js
|
|
1108
1208
|
import { Node } from '@dhis2/ui'
|
|
1109
1209
|
```
|
|
1110
1210
|
|
|
1211
|
+
|
|
1111
1212
|
#### Props
|
|
1112
1213
|
|
|
1113
|
-
|
|
|
1114
|
-
|
|
1115
|
-
|
|
|
1116
|
-
|
|
|
1117
|
-
|
|
|
1118
|
-
|
|
|
1119
|
-
|
|
|
1120
|
-
|
|
|
1121
|
-
|
|
|
1122
|
-
|
|
|
1214
|
+
|Name|Type|Default|Required|Description|
|
|
1215
|
+
|---|---|---|---|---|
|
|
1216
|
+
|children|node|||Content below this level of the hierarchy; children are revealed when this leaf is 'open'|
|
|
1217
|
+
|className|string||||
|
|
1218
|
+
|component|element|||Content/label for this leaf, for example a checkbox|
|
|
1219
|
+
|dataTest|string|`'dhis2-uicore-node'`|||
|
|
1220
|
+
|icon|node|||A custom icon to use instead of a toggle arrow|
|
|
1221
|
+
|open|boolean||||
|
|
1222
|
+
|onClose|function||||
|
|
1223
|
+
|onOpen|function||||
|
|
1123
1224
|
|
|
1124
1225
|
### NoticeBox
|
|
1125
1226
|
|
|
@@ -1127,20 +1228,22 @@ import { Node } from '@dhis2/ui'
|
|
|
1127
1228
|
|
|
1128
1229
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1129
1230
|
|
|
1231
|
+
|
|
1130
1232
|
```js
|
|
1131
1233
|
import { NoticeBox } from '@dhis2/ui'
|
|
1132
1234
|
```
|
|
1133
1235
|
|
|
1236
|
+
|
|
1134
1237
|
#### Props
|
|
1135
1238
|
|
|
1136
|
-
|
|
|
1137
|
-
|
|
1138
|
-
|
|
|
1139
|
-
|
|
|
1140
|
-
|
|
|
1141
|
-
|
|
|
1142
|
-
|
|
|
1143
|
-
|
|
|
1239
|
+
|Name|Type|Default|Required|Description|
|
|
1240
|
+
|---|---|---|---|---|
|
|
1241
|
+
|children|node||||
|
|
1242
|
+
|className|string||||
|
|
1243
|
+
|dataTest|string|`'dhis2-uicore-noticebox'`|||
|
|
1244
|
+
|error|custom|||Applies 'error' message styles. Mutually exclusive with the `warning` prop|
|
|
1245
|
+
|title|string||||
|
|
1246
|
+
|warning|custom|||Applies 'warning' message styles. Mutually exclusive with the `error` prop|
|
|
1144
1247
|
|
|
1145
1248
|
### OrganisationUnitTree
|
|
1146
1249
|
|
|
@@ -1148,34 +1251,36 @@ import { NoticeBox } from '@dhis2/ui'
|
|
|
1148
1251
|
|
|
1149
1252
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1150
1253
|
|
|
1254
|
+
|
|
1151
1255
|
```js
|
|
1152
1256
|
import { OrganisationUnitTree } from '@dhis2/ui'
|
|
1153
1257
|
```
|
|
1154
1258
|
|
|
1259
|
+
|
|
1155
1260
|
#### Props
|
|
1156
1261
|
|
|
1157
|
-
|
|
|
1158
|
-
|
|
1159
|
-
|
|
|
1160
|
-
|
|
|
1161
|
-
|
|
|
1162
|
-
|
|
|
1163
|
-
|
|
|
1164
|
-
|
|
|
1165
|
-
|
|
|
1166
|
-
|
|
|
1167
|
-
|
|
|
1168
|
-
|
|
|
1169
|
-
|
|
|
1170
|
-
|
|
|
1171
|
-
|
|
|
1172
|
-
|
|
|
1173
|
-
|
|
|
1174
|
-
|
|
|
1175
|
-
|
|
|
1176
|
-
|
|
|
1177
|
-
|
|
|
1178
|
-
|
|
|
1262
|
+
|Name|Type|Default|Required|Description|
|
|
1263
|
+
|---|---|---|---|---|
|
|
1264
|
+
|roots|string │ arrayOf(string)||*|Root org unit ID(s)|
|
|
1265
|
+
|onChange|function||*|Will be called with the following object:<br/>`{ id: string, displayName: string, path: string, checked: boolean, selected: string[] }`|
|
|
1266
|
+
|autoExpandLoadingError|boolean|||When set, the error when loading children fails will be shown automatically|
|
|
1267
|
+
|dataTest|string|`'dhis2-uiwidgets-orgunittree'`|||
|
|
1268
|
+
|disableSelection|boolean|||When set to true, no unit can be selected|
|
|
1269
|
+
|expanded|custom||||
|
|
1270
|
+
|filter|arrayOf(custom)|`[]`||All organisation units with a path that includes the provided paths will be shown.<br/>All others will not be rendered. When not provided, all org units will be shown.|
|
|
1271
|
+
|forceReload|boolean|||When true, everything will be reloaded. In order to load it again after reloading, `forceReload` has to be set to `false` and then to `true` again|
|
|
1272
|
+
|handleCollapse|custom||||
|
|
1273
|
+
|handleExpand|custom||||
|
|
1274
|
+
|highlighted|arrayOf(custom)|`[]`||All units provided to "highlighted" as path will be visually<br/>highlighted.<br/>Note:<br/>The d2-ui component used two props for this:<br/>* searchResults<br/>* highlightSearchResults|
|
|
1275
|
+
|initiallyExpanded|arrayOf(custom)|`[]`||An array of OU paths that will be expanded automatically<br/>as soon as they are encountered.<br/>The path of an OU is the UIDs of the OU<br/>and all its parent OUs separated by slashes (/)<br/>Note: This replaces "openFirstLevel" as that's redundant|
|
|
1276
|
+
|isUserDataViewFallback|boolean|||When provided, the 'isUserDataViewFallback' option will be sent when requesting the org units|
|
|
1277
|
+
|renderNodeLabel|function|`defaultRenderNodeLabel`||Renders the actual node component for each leaf, can be used to<br/>customize the node. The default function just returns the node's<br/>displayName<br/><br/>Shape of the object passed to the callback:<br/>```<br/>{<br/> label: string,<br/> node: {<br/> displayName: string,<br/> id: string,<br/> // Only provided once `loading` is false<br/> path?: string,<br/> // Only provided once `loading` is false<br/> children?: Array.<{<br/> id: string,<br/> path: string,<br/> displayName: string<br/> }><br/> },<br/> loading: boolean,<br/> error: string,<br/> open: boolean,<br/> selected: string[],<br/> singleSelection: boolean,<br/> disableSelection: boolean,<br/>}<br/>```|
|
|
1278
|
+
|selected|arrayOf(custom)|`[]`||An array of paths of selected OUs. The path of an OU is the UIDs of the OU and all its parent OUs separated by slashes (`/`)|
|
|
1279
|
+
|singleSelection|boolean|||When set, no checkboxes will be displayed and only the first selected path in `selected` will be highlighted|
|
|
1280
|
+
|suppressAlphabeticalSorting|boolean|||Turns off alphabetical sorting of units|
|
|
1281
|
+
|onChildrenLoaded|function|||Called with the children's data that was loaded|
|
|
1282
|
+
|onCollapse|function|||Called with `{ path: string }` with the path of the parent of the level closed|
|
|
1283
|
+
|onExpand|function|||Called with `{ path: string }` with the path of the parent of the level opened|
|
|
1179
1284
|
|
|
1180
1285
|
### Label
|
|
1181
1286
|
|
|
@@ -1183,30 +1288,32 @@ import { OrganisationUnitTree } from '@dhis2/ui'
|
|
|
1183
1288
|
|
|
1184
1289
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1185
1290
|
|
|
1291
|
+
|
|
1186
1292
|
```js
|
|
1187
1293
|
import { Label } from '@dhis2/ui'
|
|
1188
1294
|
```
|
|
1189
1295
|
|
|
1296
|
+
|
|
1190
1297
|
#### Props
|
|
1191
1298
|
|
|
1192
|
-
|
|
|
1193
|
-
|
|
1194
|
-
|
|
|
1195
|
-
|
|
|
1196
|
-
|
|
|
1197
|
-
|
|
|
1198
|
-
|
|
|
1199
|
-
|
|
|
1200
|
-
|
|
|
1201
|
-
|
|
|
1202
|
-
|
|
|
1203
|
-
|
|
|
1204
|
-
|
|
|
1205
|
-
|
|
|
1206
|
-
|
|
|
1207
|
-
|
|
|
1208
|
-
|
|
|
1209
|
-
|
|
|
1299
|
+
|Name|Type|Default|Required|Description|
|
|
1300
|
+
|---|---|---|---|---|
|
|
1301
|
+
|children|any||*||
|
|
1302
|
+
|dataTest|string||*||
|
|
1303
|
+
|fullPath|string||*||
|
|
1304
|
+
|hasChildren|boolean||*||
|
|
1305
|
+
|loading|boolean||*||
|
|
1306
|
+
|node|{<br/> "displayName": "string",<br/> "id": "string",<br/> "children": "number",<br/> "path": "string"<br/>}||*||
|
|
1307
|
+
|open|boolean||*||
|
|
1308
|
+
|rootId|string||*||
|
|
1309
|
+
|onChange|function||*||
|
|
1310
|
+
|onToggleOpen|function||*||
|
|
1311
|
+
|checked|boolean||||
|
|
1312
|
+
|disableSelection|boolean||||
|
|
1313
|
+
|hasSelectedDescendants|boolean||||
|
|
1314
|
+
|highlighted|boolean||||
|
|
1315
|
+
|selected|arrayOf(custom)||||
|
|
1316
|
+
|singleSelection|boolean||||
|
|
1210
1317
|
|
|
1211
1318
|
### Pagination
|
|
1212
1319
|
|
|
@@ -1214,34 +1321,36 @@ import { Label } from '@dhis2/ui'
|
|
|
1214
1321
|
|
|
1215
1322
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1216
1323
|
|
|
1324
|
+
|
|
1217
1325
|
```js
|
|
1218
1326
|
import { Pagination } from '@dhis2/ui'
|
|
1219
1327
|
```
|
|
1220
1328
|
|
|
1329
|
+
|
|
1221
1330
|
#### Props
|
|
1222
1331
|
|
|
1223
|
-
|
|
|
1224
|
-
|
|
1225
|
-
|
|
|
1226
|
-
|
|
|
1227
|
-
|
|
|
1228
|
-
|
|
|
1229
|
-
|
|
|
1230
|
-
|
|
|
1231
|
-
|
|
|
1232
|
-
|
|
|
1233
|
-
|
|
|
1234
|
-
|
|
|
1235
|
-
|
|
|
1236
|
-
|
|
|
1237
|
-
|
|
|
1238
|
-
|
|
|
1239
|
-
|
|
|
1240
|
-
|
|
|
1241
|
-
|
|
|
1242
|
-
|
|
|
1243
|
-
|
|
|
1244
|
-
|
|
|
1332
|
+
|Name|Type|Default|Required|Description|
|
|
1333
|
+
|---|---|---|---|---|
|
|
1334
|
+
|page|number||*||
|
|
1335
|
+
|pageSize|number||*||
|
|
1336
|
+
|className|string||||
|
|
1337
|
+
|dataTest|string|`'dhis2-uiwidgets-pagination'`|||
|
|
1338
|
+
|disabled|boolean||||
|
|
1339
|
+
|hidePageSelect|boolean||||
|
|
1340
|
+
|hidePageSizeSelect|boolean||||
|
|
1341
|
+
|hidePageSummary|boolean||||
|
|
1342
|
+
|isLastPage|boolean||||
|
|
1343
|
+
|nextPageText|string │ function|`() => i18n.t('Next')`|||
|
|
1344
|
+
|pageCount|number||||
|
|
1345
|
+
|pageLength|custom||||
|
|
1346
|
+
|pageSelectText|string │ function|`() => i18n.t('Page')`|||
|
|
1347
|
+
|pageSizeSelectText|string │ function|`() => i18n.t('Items per page')`|||
|
|
1348
|
+
|pageSizes|arrayOf(string)|`['5', '10', '20', '30', '40', '50', '75', '100']`|||
|
|
1349
|
+
|pageSummaryText|string │ function|`getDefaultPageSummaryText`|||
|
|
1350
|
+
|previousPageText|string │ function|`() => i18n.t('Previous')`|||
|
|
1351
|
+
|total|number||||
|
|
1352
|
+
|onPageChange|function||||
|
|
1353
|
+
|onPageSizeChange|function||||
|
|
1245
1354
|
|
|
1246
1355
|
### Popover
|
|
1247
1356
|
|
|
@@ -1249,25 +1358,27 @@ import { Pagination } from '@dhis2/ui'
|
|
|
1249
1358
|
|
|
1250
1359
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1251
1360
|
|
|
1361
|
+
|
|
1252
1362
|
```js
|
|
1253
1363
|
import { Popover } from '@dhis2/ui'
|
|
1254
1364
|
```
|
|
1255
1365
|
|
|
1366
|
+
|
|
1256
1367
|
#### Props
|
|
1257
1368
|
|
|
1258
|
-
|
|
|
1259
|
-
|
|
1260
|
-
|
|
|
1261
|
-
|
|
|
1262
|
-
|
|
|
1263
|
-
|
|
|
1264
|
-
|
|
|
1265
|
-
|
|
|
1266
|
-
|
|
|
1267
|
-
|
|
|
1268
|
-
|
|
|
1269
|
-
|
|
|
1270
|
-
|
|
|
1369
|
+
|Name|Type|Default|Required|Description|
|
|
1370
|
+
|---|---|---|---|---|
|
|
1371
|
+
|children|node||*||
|
|
1372
|
+
|arrow|boolean|`true`||Show or hide the arrow|
|
|
1373
|
+
|className|string||||
|
|
1374
|
+
|dataTest|string|`'dhis2-uicore-popover'`|||
|
|
1375
|
+
|elevation|string|`elevations.e200`||Box-shadow to create appearance of elevation. Use `elevations` constants from the UI library.|
|
|
1376
|
+
|maxWidth|number|`360`|||
|
|
1377
|
+
|observePopperResize|boolean||||
|
|
1378
|
+
|observeReferenceResize|boolean||||
|
|
1379
|
+
|placement|custom|`'top'`|||
|
|
1380
|
+
|reference|custom|||A React ref that refers to the element the Popover should position against|
|
|
1381
|
+
|onClickOutside|function||||
|
|
1271
1382
|
|
|
1272
1383
|
### Popper
|
|
1273
1384
|
|
|
@@ -1275,24 +1386,26 @@ import { Popover } from '@dhis2/ui'
|
|
|
1275
1386
|
|
|
1276
1387
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1277
1388
|
|
|
1389
|
+
|
|
1278
1390
|
```js
|
|
1279
1391
|
import { Popper } from '@dhis2/ui'
|
|
1280
1392
|
```
|
|
1281
1393
|
|
|
1394
|
+
|
|
1282
1395
|
#### Props
|
|
1283
1396
|
|
|
1284
|
-
|
|
|
1285
|
-
|
|
1286
|
-
|
|
|
1287
|
-
|
|
|
1288
|
-
|
|
|
1289
|
-
|
|
|
1290
|
-
|
|
|
1291
|
-
|
|
|
1292
|
-
|
|
|
1293
|
-
|
|
|
1294
|
-
|
|
|
1295
|
-
|
|
|
1397
|
+
|Name|Type|Default|Required|Description|
|
|
1398
|
+
|---|---|---|---|---|
|
|
1399
|
+
|children|node||*|Content inside the Popper|
|
|
1400
|
+
|className|string||||
|
|
1401
|
+
|dataTest|string|`'dhis2-uicore-popper'`|||
|
|
1402
|
+
|modifiers|arrayOf({<br/> "name": "string",<br/> "options": "object"<br/>})|`[]`||A property of the `createPopper` options. See [popper docs](https://popper.js.org/docs/v2/constructors/)|
|
|
1403
|
+
|observePopperResize|boolean|||Makes the Popper update position when the **Popper content** changes size|
|
|
1404
|
+
|observeReferenceResize|boolean|||Makes the Popper update position when the **reference element** changes size|
|
|
1405
|
+
|placement|custom|`'auto'`||A property of the `createPopper` options. See [popper docs](https://popper.js.org/docs/v2/constructors/)|
|
|
1406
|
+
|reference|custom|||A React ref, DOM node, or [virtual element](https://popper.js.org/docs/v2/virtual-elements/) for the popper to position itself against|
|
|
1407
|
+
|strategy|'absolute' │ 'fixed'|||A property of the `createPopper` options. See [popper docs](https://popper.js.org/docs/v2/constructors/)|
|
|
1408
|
+
|onFirstUpdate|function|||A property of the `createPopper` options. See [popper docs](https://popper.js.org/docs/v2/constructors/)|
|
|
1296
1409
|
|
|
1297
1410
|
### Radio
|
|
1298
1411
|
|
|
@@ -1300,30 +1413,32 @@ import { Popper } from '@dhis2/ui'
|
|
|
1300
1413
|
|
|
1301
1414
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1302
1415
|
|
|
1416
|
+
|
|
1303
1417
|
```js
|
|
1304
1418
|
import { Radio } from '@dhis2/ui'
|
|
1305
1419
|
```
|
|
1306
1420
|
|
|
1421
|
+
|
|
1307
1422
|
#### Props
|
|
1308
1423
|
|
|
1309
|
-
|
|
|
1310
|
-
|
|
1311
|
-
|
|
|
1312
|
-
|
|
|
1313
|
-
|
|
|
1314
|
-
|
|
|
1315
|
-
|
|
|
1316
|
-
|
|
|
1317
|
-
|
|
|
1318
|
-
|
|
|
1319
|
-
|
|
|
1320
|
-
|
|
|
1321
|
-
|
|
|
1322
|
-
|
|
|
1323
|
-
|
|
|
1324
|
-
|
|
|
1325
|
-
|
|
|
1326
|
-
|
|
|
1424
|
+
|Name|Type|Default|Required|Description|
|
|
1425
|
+
|---|---|---|---|---|
|
|
1426
|
+
|checked|boolean||||
|
|
1427
|
+
|className|string||||
|
|
1428
|
+
|dataTest|string|`'dhis2-uicore-radio'`|||
|
|
1429
|
+
|dense|boolean||||
|
|
1430
|
+
|disabled|boolean||||
|
|
1431
|
+
|error|custom|||Adds 'error' styling for feedback. Mutually exclusive with `valid` and `warning` props|
|
|
1432
|
+
|initialFocus|boolean||||
|
|
1433
|
+
|label|node||||
|
|
1434
|
+
|name|string|||Name associated with this element. Passed in object to event handler functions|
|
|
1435
|
+
|tabIndex|string||||
|
|
1436
|
+
|valid|custom|||Adds 'valid' styling for feedback. Mutually exclusive with `error` and `warning` props|
|
|
1437
|
+
|value|string|||Value associated with this element. Passed in object to event handler functions|
|
|
1438
|
+
|warning|custom|||Adds 'warning' styling for feedback. Mutually exclusive with `valid` and `error` props|
|
|
1439
|
+
|onBlur|function|||Called with the signature `({ name: string, value: string, checked: bool }, event)`|
|
|
1440
|
+
|onChange|function|||Called with the signature `({ name: string, value: string, checked: bool }, event)`|
|
|
1441
|
+
|onFocus|function|||Called with the signature `({ name: string, value: string, checked: bool }, event)`|
|
|
1327
1442
|
|
|
1328
1443
|
### Required
|
|
1329
1444
|
|
|
@@ -1331,15 +1446,17 @@ import { Radio } from '@dhis2/ui'
|
|
|
1331
1446
|
|
|
1332
1447
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1333
1448
|
|
|
1449
|
+
|
|
1334
1450
|
```js
|
|
1335
1451
|
import { Required } from '@dhis2/ui'
|
|
1336
1452
|
```
|
|
1337
1453
|
|
|
1454
|
+
|
|
1338
1455
|
#### Props
|
|
1339
1456
|
|
|
1340
|
-
|
|
|
1341
|
-
|
|
1342
|
-
|
|
|
1457
|
+
|Name|Type|Default|Required|Description|
|
|
1458
|
+
|---|---|---|---|---|
|
|
1459
|
+
|dataTest|string||*||
|
|
1343
1460
|
|
|
1344
1461
|
### SegmentedControl
|
|
1345
1462
|
|
|
@@ -1347,17 +1464,19 @@ import { Required } from '@dhis2/ui'
|
|
|
1347
1464
|
|
|
1348
1465
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1349
1466
|
|
|
1467
|
+
|
|
1350
1468
|
```js
|
|
1351
1469
|
import { SegmentedControl } from '@dhis2/ui'
|
|
1352
1470
|
```
|
|
1353
1471
|
|
|
1472
|
+
|
|
1354
1473
|
#### Props
|
|
1355
1474
|
|
|
1356
|
-
|
|
|
1357
|
-
|
|
1358
|
-
|
|
|
1359
|
-
|
|
|
1360
|
-
|
|
|
1475
|
+
|Name|Type|Default|Required|Description|
|
|
1476
|
+
|---|---|---|---|---|
|
|
1477
|
+
|options|arrayOf({<br/> "label": "string",<br/> "value": "string",<br/> "disabled": "boolean"<br/>})||*|Options to populate the segmented control|
|
|
1478
|
+
|selected|string||*|An option to select; should match the `value` property of the option to be selected|
|
|
1479
|
+
|onChange|function||*|Called with the signature `({ value: string }, event)`|
|
|
1361
1480
|
|
|
1362
1481
|
### Input
|
|
1363
1482
|
|
|
@@ -1365,25 +1484,27 @@ import { SegmentedControl } from '@dhis2/ui'
|
|
|
1365
1484
|
|
|
1366
1485
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1367
1486
|
|
|
1487
|
+
|
|
1368
1488
|
```js
|
|
1369
1489
|
import { Input } from '@dhis2/ui'
|
|
1370
1490
|
```
|
|
1371
1491
|
|
|
1492
|
+
|
|
1372
1493
|
#### Props
|
|
1373
1494
|
|
|
1374
|
-
|
|
|
1375
|
-
|
|
1376
|
-
|
|
|
1377
|
-
|
|
|
1378
|
-
|
|
|
1379
|
-
|
|
|
1380
|
-
|
|
|
1381
|
-
|
|
|
1382
|
-
|
|
|
1383
|
-
|
|
|
1384
|
-
|
|
|
1385
|
-
|
|
|
1386
|
-
|
|
|
1495
|
+
|Name|Type|Default|Required|Description|
|
|
1496
|
+
|---|---|---|---|---|
|
|
1497
|
+
|dataTest|string||*||
|
|
1498
|
+
|className|string||||
|
|
1499
|
+
|clearText|custom||||
|
|
1500
|
+
|clearable|boolean||||
|
|
1501
|
+
|disabled|boolean||||
|
|
1502
|
+
|inputMaxHeight|string|`'100px'`|||
|
|
1503
|
+
|options|node||||
|
|
1504
|
+
|placeholder|string||||
|
|
1505
|
+
|prefix|string||||
|
|
1506
|
+
|selected|arrayOf(string)||||
|
|
1507
|
+
|onChange|function||||
|
|
1387
1508
|
|
|
1388
1509
|
### Menu
|
|
1389
1510
|
|
|
@@ -1391,19 +1512,21 @@ import { Input } from '@dhis2/ui'
|
|
|
1391
1512
|
|
|
1392
1513
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1393
1514
|
|
|
1515
|
+
|
|
1394
1516
|
```js
|
|
1395
1517
|
import { Menu } from '@dhis2/ui'
|
|
1396
1518
|
```
|
|
1397
1519
|
|
|
1520
|
+
|
|
1398
1521
|
#### Props
|
|
1399
1522
|
|
|
1400
|
-
|
|
|
1401
|
-
|
|
1402
|
-
|
|
|
1403
|
-
|
|
|
1404
|
-
|
|
|
1405
|
-
|
|
|
1406
|
-
|
|
|
1523
|
+
|Name|Type|Default|Required|Description|
|
|
1524
|
+
|---|---|---|---|---|
|
|
1525
|
+
|dataTest|string||*||
|
|
1526
|
+
|empty|node|`''`|||
|
|
1527
|
+
|options|node||||
|
|
1528
|
+
|selected|arrayOf(string)||||
|
|
1529
|
+
|onChange|function||||
|
|
1407
1530
|
|
|
1408
1531
|
### MultiSelect
|
|
1409
1532
|
|
|
@@ -1411,40 +1534,42 @@ import { Menu } from '@dhis2/ui'
|
|
|
1411
1534
|
|
|
1412
1535
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1413
1536
|
|
|
1537
|
+
|
|
1414
1538
|
```js
|
|
1415
1539
|
import { MultiSelect } from '@dhis2/ui'
|
|
1416
1540
|
```
|
|
1417
1541
|
|
|
1542
|
+
|
|
1418
1543
|
#### Props
|
|
1419
1544
|
|
|
1420
|
-
|
|
|
1421
|
-
|
|
1422
|
-
|
|
|
1423
|
-
|
|
|
1424
|
-
|
|
|
1425
|
-
|
|
|
1426
|
-
|
|
|
1427
|
-
|
|
|
1428
|
-
|
|
|
1429
|
-
|
|
|
1430
|
-
|
|
|
1431
|
-
|
|
|
1432
|
-
|
|
|
1433
|
-
|
|
|
1434
|
-
|
|
|
1435
|
-
|
|
|
1436
|
-
|
|
|
1437
|
-
|
|
|
1438
|
-
|
|
|
1439
|
-
|
|
|
1440
|
-
|
|
|
1441
|
-
|
|
|
1442
|
-
|
|
|
1443
|
-
|
|
|
1444
|
-
|
|
|
1445
|
-
|
|
|
1446
|
-
|
|
|
1447
|
-
|
|
|
1545
|
+
|Name|Type|Default|Required|Description|
|
|
1546
|
+
|---|---|---|---|---|
|
|
1547
|
+
|children|node||||
|
|
1548
|
+
|className|string||||
|
|
1549
|
+
|clearText|custom|||Required if `clearable` prop is `true`|
|
|
1550
|
+
|clearable|boolean|||Adds a 'clear' option to the menu|
|
|
1551
|
+
|dataTest|string|`'dhis2-uicore-multiselect'`|||
|
|
1552
|
+
|dense|boolean||||
|
|
1553
|
+
|disabled|boolean||||
|
|
1554
|
+
|empty|node||||
|
|
1555
|
+
|error|custom||||
|
|
1556
|
+
|filterPlaceholder|string||||
|
|
1557
|
+
|filterable|boolean|||Adds a 'filter' field to the menu|
|
|
1558
|
+
|initialFocus|boolean||||
|
|
1559
|
+
|inputMaxHeight|string||||
|
|
1560
|
+
|loading|boolean||||
|
|
1561
|
+
|loadingText|string||||
|
|
1562
|
+
|maxHeight|string||||
|
|
1563
|
+
|noMatchText|custom|||Required if `filterable` prop is `true`|
|
|
1564
|
+
|placeholder|string||||
|
|
1565
|
+
|prefix|string||||
|
|
1566
|
+
|selected|arrayOf(string)|`[]`|||
|
|
1567
|
+
|tabIndex|string||||
|
|
1568
|
+
|valid|custom||||
|
|
1569
|
+
|warning|custom||||
|
|
1570
|
+
|onBlur|function||||
|
|
1571
|
+
|onChange|function||||
|
|
1572
|
+
|onFocus|function||||
|
|
1448
1573
|
|
|
1449
1574
|
### MultiSelectField
|
|
1450
1575
|
|
|
@@ -1452,45 +1577,47 @@ import { MultiSelect } from '@dhis2/ui'
|
|
|
1452
1577
|
|
|
1453
1578
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1454
1579
|
|
|
1580
|
+
|
|
1455
1581
|
```js
|
|
1456
1582
|
import { MultiSelectField } from '@dhis2/ui'
|
|
1457
1583
|
```
|
|
1458
1584
|
|
|
1585
|
+
|
|
1459
1586
|
#### Props
|
|
1460
1587
|
|
|
1461
|
-
|
|
|
1462
|
-
|
|
1463
|
-
|
|
|
1464
|
-
|
|
|
1465
|
-
|
|
|
1466
|
-
|
|
|
1467
|
-
|
|
|
1468
|
-
|
|
|
1469
|
-
|
|
|
1470
|
-
|
|
|
1471
|
-
|
|
|
1472
|
-
|
|
|
1473
|
-
|
|
|
1474
|
-
|
|
|
1475
|
-
|
|
|
1476
|
-
|
|
|
1477
|
-
|
|
|
1478
|
-
|
|
|
1479
|
-
|
|
|
1480
|
-
|
|
|
1481
|
-
|
|
|
1482
|
-
|
|
|
1483
|
-
|
|
|
1484
|
-
|
|
|
1485
|
-
|
|
|
1486
|
-
|
|
|
1487
|
-
|
|
|
1488
|
-
|
|
|
1489
|
-
|
|
|
1490
|
-
|
|
|
1491
|
-
|
|
|
1492
|
-
|
|
|
1493
|
-
|
|
|
1588
|
+
|Name|Type|Default|Required|Description|
|
|
1589
|
+
|---|---|---|---|---|
|
|
1590
|
+
|children|node|||Should be `MultiSelectOption` components|
|
|
1591
|
+
|className|string||||
|
|
1592
|
+
|clearText|string │ function|`() => i18n.t('Clear')`||Label for the button that clears selections|
|
|
1593
|
+
|clearable|boolean|||Adds a button to the MultiSelect that clears selections when pressed|
|
|
1594
|
+
|dataTest|string|`'dhis2-uiwidgets-multiselectfield'`|||
|
|
1595
|
+
|dense|boolean|||Makes the MultiSelect smaller|
|
|
1596
|
+
|disabled|boolean|||Disables the MultiSelect|
|
|
1597
|
+
|empty|node │ function|`() => i18n.t('No data found')`||Text to display when there are no options|
|
|
1598
|
+
|error|custom|||Adds 'error' appearance for validation feedback. Mutually exclusive with 'valid' and 'warning' props|
|
|
1599
|
+
|filterPlaceholder|node │ function|`() => i18n.t('Type to filter options')`||Placeholder text to show in the filter field when it is empty|
|
|
1600
|
+
|filterable|boolean|||Adds a field to filter options|
|
|
1601
|
+
|helpText|string|||Useful guiding text to display below the MultiSelect|
|
|
1602
|
+
|initialFocus|boolean|||Grabs initial focus on the page|
|
|
1603
|
+
|inputMaxHeight|string|||Constrains the height of the input|
|
|
1604
|
+
|inputWidth|string|||Sets the width of the input. Can be any valid CSS measurement|
|
|
1605
|
+
|label|string|||Text for the label above the MultiSelect|
|
|
1606
|
+
|loading|boolean|||Applies a loading appearance to the dropdown options|
|
|
1607
|
+
|loadingText|string │ function|`() => i18n.t('Loading options')`||Text to display when `loading` is true|
|
|
1608
|
+
|maxHeight|string|||Constrains height of the MultiSelect|
|
|
1609
|
+
|noMatchText|string │ function|`() => i18n.t('No options found')`||Text to display when there are no filter results|
|
|
1610
|
+
|placeholder|string|||Placeholder text when the MultiSelect is empty|
|
|
1611
|
+
|prefix|string|||Leading text to prefix selections|
|
|
1612
|
+
|required|boolean|||Indicates that a selection is required|
|
|
1613
|
+
|selected|arrayOf(string)|`[]`||Selected items in the MultiSelect (each string should refer to the item's `value` attribute)|
|
|
1614
|
+
|tabIndex|string||||
|
|
1615
|
+
|valid|custom|||Adds 'valid' appearance for validation feedback. Mutually exclusive with 'error' and 'warning' props|
|
|
1616
|
+
|validationText|string|||Text to provide form validation feedback. Receives styles according to validation status|
|
|
1617
|
+
|warning|custom|||Adds 'warning' appearance for validation feedback. Mutually exclusive with 'valid' and 'error' props|
|
|
1618
|
+
|onBlur|function|||Called with signature `({ selected: [String] }, event)`|
|
|
1619
|
+
|onChange|function|||Called with signature `({ selected: [String] }, event)`|
|
|
1620
|
+
|onFocus|function|||Called with signature `({ selected: [String] }, event)`|
|
|
1494
1621
|
|
|
1495
1622
|
### MultiSelectOption
|
|
1496
1623
|
|
|
@@ -1498,21 +1625,23 @@ import { MultiSelectField } from '@dhis2/ui'
|
|
|
1498
1625
|
|
|
1499
1626
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1500
1627
|
|
|
1628
|
+
|
|
1501
1629
|
```js
|
|
1502
1630
|
import { MultiSelectOption } from '@dhis2/ui'
|
|
1503
1631
|
```
|
|
1504
1632
|
|
|
1633
|
+
|
|
1505
1634
|
#### Props
|
|
1506
1635
|
|
|
1507
|
-
|
|
|
1508
|
-
|
|
1509
|
-
|
|
|
1510
|
-
|
|
|
1511
|
-
|
|
|
1512
|
-
|
|
|
1513
|
-
|
|
|
1514
|
-
|
|
|
1515
|
-
|
|
|
1636
|
+
|Name|Type|Default|Required|Description|
|
|
1637
|
+
|---|---|---|---|---|
|
|
1638
|
+
|label|string||*||
|
|
1639
|
+
|value|string||*||
|
|
1640
|
+
|active|boolean||||
|
|
1641
|
+
|className|string||||
|
|
1642
|
+
|dataTest|string|`'dhis2-uicore-multiselectoption'`|||
|
|
1643
|
+
|disabled|boolean||||
|
|
1644
|
+
|onClick|function||||
|
|
1516
1645
|
|
|
1517
1646
|
### Input
|
|
1518
1647
|
|
|
@@ -1520,25 +1649,27 @@ import { MultiSelectOption } from '@dhis2/ui'
|
|
|
1520
1649
|
|
|
1521
1650
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1522
1651
|
|
|
1652
|
+
|
|
1523
1653
|
```js
|
|
1524
1654
|
import { Input } from '@dhis2/ui'
|
|
1525
1655
|
```
|
|
1526
1656
|
|
|
1657
|
+
|
|
1527
1658
|
#### Props
|
|
1528
1659
|
|
|
1529
|
-
|
|
|
1530
|
-
|
|
1531
|
-
|
|
|
1532
|
-
|
|
|
1533
|
-
|
|
|
1534
|
-
|
|
|
1535
|
-
|
|
|
1536
|
-
|
|
|
1537
|
-
|
|
|
1538
|
-
|
|
|
1539
|
-
|
|
|
1540
|
-
|
|
|
1541
|
-
|
|
|
1660
|
+
|Name|Type|Default|Required|Description|
|
|
1661
|
+
|---|---|---|---|---|
|
|
1662
|
+
|dataTest|string||*||
|
|
1663
|
+
|className|string||||
|
|
1664
|
+
|clearText|custom||||
|
|
1665
|
+
|clearable|boolean||||
|
|
1666
|
+
|disabled|boolean||||
|
|
1667
|
+
|inputMaxHeight|string|`'100px'`|||
|
|
1668
|
+
|options|node||||
|
|
1669
|
+
|placeholder|string||||
|
|
1670
|
+
|prefix|string||||
|
|
1671
|
+
|selected|string||||
|
|
1672
|
+
|onChange|function||||
|
|
1542
1673
|
|
|
1543
1674
|
### Menu
|
|
1544
1675
|
|
|
@@ -1546,21 +1677,23 @@ import { Input } from '@dhis2/ui'
|
|
|
1546
1677
|
|
|
1547
1678
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1548
1679
|
|
|
1680
|
+
|
|
1549
1681
|
```js
|
|
1550
1682
|
import { Menu } from '@dhis2/ui'
|
|
1551
1683
|
```
|
|
1552
1684
|
|
|
1685
|
+
|
|
1553
1686
|
#### Props
|
|
1554
1687
|
|
|
1555
|
-
|
|
|
1556
|
-
|
|
1557
|
-
|
|
|
1558
|
-
|
|
|
1559
|
-
|
|
|
1560
|
-
|
|
|
1561
|
-
|
|
|
1562
|
-
|
|
|
1563
|
-
|
|
|
1688
|
+
|Name|Type|Default|Required|Description|
|
|
1689
|
+
|---|---|---|---|---|
|
|
1690
|
+
|dataTest|string||*||
|
|
1691
|
+
|empty|node|`''`|||
|
|
1692
|
+
|handleClose|function||||
|
|
1693
|
+
|handleFocusInput|function||||
|
|
1694
|
+
|options|node||||
|
|
1695
|
+
|selected|string||||
|
|
1696
|
+
|onChange|function||||
|
|
1564
1697
|
|
|
1565
1698
|
### SingleSelect
|
|
1566
1699
|
|
|
@@ -1568,40 +1701,42 @@ import { Menu } from '@dhis2/ui'
|
|
|
1568
1701
|
|
|
1569
1702
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1570
1703
|
|
|
1704
|
+
|
|
1571
1705
|
```js
|
|
1572
1706
|
import { SingleSelect } from '@dhis2/ui'
|
|
1573
1707
|
```
|
|
1574
1708
|
|
|
1709
|
+
|
|
1575
1710
|
#### Props
|
|
1576
1711
|
|
|
1577
|
-
|
|
|
1578
|
-
|
|
1579
|
-
|
|
|
1580
|
-
|
|
|
1581
|
-
|
|
|
1582
|
-
|
|
|
1583
|
-
|
|
|
1584
|
-
|
|
|
1585
|
-
|
|
|
1586
|
-
|
|
|
1587
|
-
|
|
|
1588
|
-
|
|
|
1589
|
-
|
|
|
1590
|
-
|
|
|
1591
|
-
|
|
|
1592
|
-
|
|
|
1593
|
-
|
|
|
1594
|
-
|
|
|
1595
|
-
|
|
|
1596
|
-
|
|
|
1597
|
-
|
|
|
1598
|
-
|
|
|
1599
|
-
|
|
|
1600
|
-
|
|
|
1601
|
-
|
|
|
1602
|
-
|
|
|
1603
|
-
|
|
|
1604
|
-
|
|
|
1712
|
+
|Name|Type|Default|Required|Description|
|
|
1713
|
+
|---|---|---|---|---|
|
|
1714
|
+
|children|node||||
|
|
1715
|
+
|className|string||||
|
|
1716
|
+
|clearText|custom|||Text on button that clears selection. Required if `clearable` prop is true|
|
|
1717
|
+
|clearable|boolean|||Adds a button to clear selection|
|
|
1718
|
+
|dataTest|string|`'dhis2-uicore-singleselect'`|||
|
|
1719
|
+
|dense|boolean||||
|
|
1720
|
+
|disabled|boolean||||
|
|
1721
|
+
|empty|node|||Text or component to display when there are no options|
|
|
1722
|
+
|error|custom|||Applies 'error' appearance for validation feedback. Mutually exclusive with `warning` and `valid` props|
|
|
1723
|
+
|filterPlaceholder|string||||
|
|
1724
|
+
|filterable|boolean|||Adds a filter field to add text to filter options|
|
|
1725
|
+
|initialFocus|boolean||||
|
|
1726
|
+
|inputMaxHeight|string||||
|
|
1727
|
+
|loading|boolean||||
|
|
1728
|
+
|loadingText|string||||
|
|
1729
|
+
|maxHeight|string||||
|
|
1730
|
+
|noMatchText|custom|||Text to show when filter returns no results. Required if `filterable` prop is true|
|
|
1731
|
+
|placeholder|string||||
|
|
1732
|
+
|prefix|string||||
|
|
1733
|
+
|selected|string|`''`|||
|
|
1734
|
+
|tabIndex|string||||
|
|
1735
|
+
|valid|custom|||Applies 'valid' appearance for validation feedback. Mutually exclusive with `warning` and `error` props|
|
|
1736
|
+
|warning|custom|||Applies 'warning' appearance for validation feedback. Mutually exclusive with `valid` and `error` props|
|
|
1737
|
+
|onBlur|function||||
|
|
1738
|
+
|onChange|function||||
|
|
1739
|
+
|onFocus|function||||
|
|
1605
1740
|
|
|
1606
1741
|
### SingleSelectField
|
|
1607
1742
|
|
|
@@ -1609,45 +1744,47 @@ import { SingleSelect } from '@dhis2/ui'
|
|
|
1609
1744
|
|
|
1610
1745
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1611
1746
|
|
|
1747
|
+
|
|
1612
1748
|
```js
|
|
1613
1749
|
import { SingleSelectField } from '@dhis2/ui'
|
|
1614
1750
|
```
|
|
1615
1751
|
|
|
1752
|
+
|
|
1616
1753
|
#### Props
|
|
1617
1754
|
|
|
1618
|
-
|
|
|
1619
|
-
|
|
1620
|
-
|
|
|
1621
|
-
|
|
|
1622
|
-
|
|
|
1623
|
-
|
|
|
1624
|
-
|
|
|
1625
|
-
|
|
|
1626
|
-
|
|
|
1627
|
-
|
|
|
1628
|
-
|
|
|
1629
|
-
|
|
|
1630
|
-
|
|
|
1631
|
-
|
|
|
1632
|
-
|
|
|
1633
|
-
|
|
|
1634
|
-
|
|
|
1635
|
-
|
|
|
1636
|
-
|
|
|
1637
|
-
|
|
|
1638
|
-
|
|
|
1639
|
-
|
|
|
1640
|
-
|
|
|
1641
|
-
|
|
|
1642
|
-
|
|
|
1643
|
-
|
|
|
1644
|
-
|
|
|
1645
|
-
|
|
|
1646
|
-
|
|
|
1647
|
-
|
|
|
1648
|
-
|
|
|
1649
|
-
|
|
|
1650
|
-
|
|
|
1755
|
+
|Name|Type|Default|Required|Description|
|
|
1756
|
+
|---|---|---|---|---|
|
|
1757
|
+
|children|node|||Should be `SingleSelectOption` components|
|
|
1758
|
+
|className|string||||
|
|
1759
|
+
|clearText|string │ function|`() => i18n.t('Clear')`||Label for the button that clears selections|
|
|
1760
|
+
|clearable|boolean|||Adds a button to the SingleSelect that clears selections when pressed|
|
|
1761
|
+
|dataTest|string|`'dhis2-uiwidgets-singleselectfield'`|||
|
|
1762
|
+
|dense|boolean|||Makes the SingleSelect smaller|
|
|
1763
|
+
|disabled|boolean|||Disables the SingleSelect|
|
|
1764
|
+
|empty|node │ function|`() => i18n.t('No data found')`||Text to display when there are no options|
|
|
1765
|
+
|error|custom|||Adds 'error' appearance for validation feedback. Mutually exclusive with 'valid' and 'warning' props|
|
|
1766
|
+
|filterPlaceholder|node │ function|`() => i18n.t('Type to filter options')`||Placeholder text to show in the filter field when it is empty|
|
|
1767
|
+
|filterable|boolean|||Adds a field to filter options|
|
|
1768
|
+
|helpText|string|||Useful guiding text to display below the SingleSelect|
|
|
1769
|
+
|initialFocus|boolean|||Grabs initial focus on the page|
|
|
1770
|
+
|inputMaxHeight|string|||Constrains the height of the input|
|
|
1771
|
+
|inputWidth|string|||Sets the width of the input. Can be any valid CSS measurement|
|
|
1772
|
+
|label|string|||Text for the label above the SingleSelect|
|
|
1773
|
+
|loading|boolean|||Applies a loading appearance to the dropdown options|
|
|
1774
|
+
|loadingText|string │ function|`() => i18n.t('Loading options')`||Text to display when `loading` is true|
|
|
1775
|
+
|maxHeight|string|||Constrains height of the SingleSelect|
|
|
1776
|
+
|noMatchText|string │ function|`() => i18n.t('No options found')`||Text to display when there are no filter results|
|
|
1777
|
+
|placeholder|string|||Placeholder text when the SingleSelect is empty|
|
|
1778
|
+
|prefix|string|||Leading text to prefix selections|
|
|
1779
|
+
|required|boolean|||Indicates that a selection is required|
|
|
1780
|
+
|selected|string|`''`||Selected item in the SingleSelect (the string should refer to the item's `value` attribute)|
|
|
1781
|
+
|tabIndex|string||||
|
|
1782
|
+
|valid|custom|||Adds 'valid' appearance for validation feedback. Mutually exclusive with 'error' and 'warning' props|
|
|
1783
|
+
|validationText|string|||Text to provide form validation feedback. Receives styles according to validation status|
|
|
1784
|
+
|warning|custom|||Adds 'warning' appearance for validation feedback. Mutually exclusive with 'valid' and 'error' props|
|
|
1785
|
+
|onBlur|function|||Called with signature `({ selected: string }, event)`|
|
|
1786
|
+
|onChange|function|||Called with signature `({ selected: string }, event)`|
|
|
1787
|
+
|onFocus|function|||Called with signature `({ selected: string }, event)`|
|
|
1651
1788
|
|
|
1652
1789
|
### SingleSelectOption
|
|
1653
1790
|
|
|
@@ -1655,21 +1792,23 @@ import { SingleSelectField } from '@dhis2/ui'
|
|
|
1655
1792
|
|
|
1656
1793
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1657
1794
|
|
|
1795
|
+
|
|
1658
1796
|
```js
|
|
1659
1797
|
import { SingleSelectOption } from '@dhis2/ui'
|
|
1660
1798
|
```
|
|
1661
1799
|
|
|
1800
|
+
|
|
1662
1801
|
#### Props
|
|
1663
1802
|
|
|
1664
|
-
|
|
|
1665
|
-
|
|
1666
|
-
|
|
|
1667
|
-
|
|
|
1668
|
-
|
|
|
1669
|
-
|
|
|
1670
|
-
|
|
|
1671
|
-
|
|
|
1672
|
-
|
|
|
1803
|
+
|Name|Type|Default|Required|Description|
|
|
1804
|
+
|---|---|---|---|---|
|
|
1805
|
+
|label|string||*||
|
|
1806
|
+
|value|string||*||
|
|
1807
|
+
|active|boolean||||
|
|
1808
|
+
|className|string||||
|
|
1809
|
+
|dataTest|string|`'dhis2-uicore-singleselectoption'`|||
|
|
1810
|
+
|disabled|boolean||||
|
|
1811
|
+
|onClick|function||||
|
|
1673
1812
|
|
|
1674
1813
|
### SelectorBar
|
|
1675
1814
|
|
|
@@ -1677,20 +1816,22 @@ import { SingleSelectOption } from '@dhis2/ui'
|
|
|
1677
1816
|
|
|
1678
1817
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1679
1818
|
|
|
1819
|
+
|
|
1680
1820
|
```js
|
|
1681
1821
|
import { SelectorBar } from '@dhis2/ui'
|
|
1682
1822
|
```
|
|
1683
1823
|
|
|
1824
|
+
|
|
1684
1825
|
#### Props
|
|
1685
1826
|
|
|
1686
|
-
|
|
|
1687
|
-
|
|
1688
|
-
|
|
|
1689
|
-
|
|
|
1690
|
-
|
|
|
1691
|
-
|
|
|
1692
|
-
|
|
|
1693
|
-
|
|
|
1827
|
+
|Name|Type|Default|Required|Description|
|
|
1828
|
+
|---|---|---|---|---|
|
|
1829
|
+
|children|any||*||
|
|
1830
|
+
|additionalContent|any||||
|
|
1831
|
+
|className|string||||
|
|
1832
|
+
|dataTest|string|`'dhis2-ui-selectorbar'`|||
|
|
1833
|
+
|disableClearSelections|boolean||||
|
|
1834
|
+
|onClearSelectionClick|function||||
|
|
1694
1835
|
|
|
1695
1836
|
### SelectorBarItem
|
|
1696
1837
|
|
|
@@ -1698,23 +1839,25 @@ import { SelectorBar } from '@dhis2/ui'
|
|
|
1698
1839
|
|
|
1699
1840
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1700
1841
|
|
|
1842
|
+
|
|
1701
1843
|
```js
|
|
1702
1844
|
import { SelectorBarItem } from '@dhis2/ui'
|
|
1703
1845
|
```
|
|
1704
1846
|
|
|
1847
|
+
|
|
1705
1848
|
#### Props
|
|
1706
1849
|
|
|
1707
|
-
|
|
|
1708
|
-
|
|
1709
|
-
|
|
|
1710
|
-
|
|
|
1711
|
-
|
|
|
1712
|
-
|
|
|
1713
|
-
|
|
|
1714
|
-
|
|
|
1715
|
-
|
|
|
1716
|
-
|
|
|
1717
|
-
|
|
|
1850
|
+
|Name|Type|Default|Required|Description|
|
|
1851
|
+
|---|---|---|---|---|
|
|
1852
|
+
|children|any||*||
|
|
1853
|
+
|label|string||*||
|
|
1854
|
+
|noValueMessage|string||*||
|
|
1855
|
+
|open|boolean||*||
|
|
1856
|
+
|setOpen|function||*||
|
|
1857
|
+
|className|string||||
|
|
1858
|
+
|dataTest|string|`'dhis2-ui-selectorbaritem'`|||
|
|
1859
|
+
|disabled|boolean||||
|
|
1860
|
+
|value|string||||
|
|
1718
1861
|
|
|
1719
1862
|
### SharingDialog
|
|
1720
1863
|
|
|
@@ -1722,17 +1865,18 @@ import { SelectorBarItem } from '@dhis2/ui'
|
|
|
1722
1865
|
|
|
1723
1866
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1724
1867
|
|
|
1868
|
+
|
|
1725
1869
|
```js
|
|
1726
1870
|
import { SharingDialog } from '@dhis2/ui'
|
|
1727
1871
|
```
|
|
1728
1872
|
|
|
1729
|
-
#### Props
|
|
1730
1873
|
|
|
1731
|
-
|
|
1732
|
-
| ---- | -------- | ------- | -------- | ----------------------------- |
|
|
1733
|
-
| id | string | | \* | The id of the object to share |
|
|
1734
|
-
| type | import { |
|
|
1874
|
+
#### Props
|
|
1735
1875
|
|
|
1876
|
+
|Name|Type|Default|Required|Description|
|
|
1877
|
+
|---|---|---|---|---|
|
|
1878
|
+
|id|string||*|The id of the object to share|
|
|
1879
|
+
|type|import {
|
|
1736
1880
|
ACCESS_NONE,
|
|
1737
1881
|
ACCESS_VIEW_ONLY,
|
|
1738
1882
|
ACCESS_VIEW_AND_EDIT,
|
|
@@ -1740,33 +1884,38 @@ import { SharingDialog } from '@dhis2/ui'
|
|
|
1740
1884
|
DASHBOARD,
|
|
1741
1885
|
EVENT_VISUALIZATION,
|
|
1742
1886
|
INTERPRETATION,
|
|
1743
|
-
|
|
1744
1887
|
} from './constants.js' │ import {
|
|
1745
|
-
ACCESS_NONE,
|
|
1746
|
-
ACCESS_VIEW_ONLY,
|
|
1747
|
-
ACCESS_VIEW_AND_EDIT,
|
|
1748
|
-
VISUALIZATION,
|
|
1749
|
-
DASHBOARD,
|
|
1750
|
-
EVENT_VISUALIZATION,
|
|
1751
|
-
INTERPRETATION,
|
|
1888
|
+
ACCESS_NONE,
|
|
1889
|
+
ACCESS_VIEW_ONLY,
|
|
1890
|
+
ACCESS_VIEW_AND_EDIT,
|
|
1891
|
+
VISUALIZATION,
|
|
1892
|
+
DASHBOARD,
|
|
1893
|
+
EVENT_VISUALIZATION,
|
|
1894
|
+
INTERPRETATION,
|
|
1752
1895
|
} from './constants.js' │ import {
|
|
1753
|
-
ACCESS_NONE,
|
|
1754
|
-
ACCESS_VIEW_ONLY,
|
|
1755
|
-
ACCESS_VIEW_AND_EDIT,
|
|
1756
|
-
VISUALIZATION,
|
|
1757
|
-
DASHBOARD,
|
|
1758
|
-
EVENT_VISUALIZATION,
|
|
1759
|
-
INTERPRETATION,
|
|
1896
|
+
ACCESS_NONE,
|
|
1897
|
+
ACCESS_VIEW_ONLY,
|
|
1898
|
+
ACCESS_VIEW_AND_EDIT,
|
|
1899
|
+
VISUALIZATION,
|
|
1900
|
+
DASHBOARD,
|
|
1901
|
+
EVENT_VISUALIZATION,
|
|
1902
|
+
INTERPRETATION,
|
|
1760
1903
|
} from './constants.js' │ import {
|
|
1761
|
-
ACCESS_NONE,
|
|
1762
|
-
ACCESS_VIEW_ONLY,
|
|
1763
|
-
ACCESS_VIEW_AND_EDIT,
|
|
1764
|
-
VISUALIZATION,
|
|
1765
|
-
DASHBOARD,
|
|
1766
|
-
EVENT_VISUALIZATION,
|
|
1767
|
-
INTERPRETATION,
|
|
1768
|
-
} from './constants.js'
|
|
1769
|
-
|initialSharingSettings|{<br/>
|
|
1904
|
+
ACCESS_NONE,
|
|
1905
|
+
ACCESS_VIEW_ONLY,
|
|
1906
|
+
ACCESS_VIEW_AND_EDIT,
|
|
1907
|
+
VISUALIZATION,
|
|
1908
|
+
DASHBOARD,
|
|
1909
|
+
EVENT_VISUALIZATION,
|
|
1910
|
+
INTERPRETATION,
|
|
1911
|
+
} from './constants.js'||*|The type of object to share|
|
|
1912
|
+
|initialSharingSettings|{<br/> "allowPublic": "boolean",<br/> "groups": "objectOf",<br/> "name": "string",<br/> "public": "import {\n ACCESS_NONE,\n ACCESS_VIEW_ONLY,\n ACCESS_VIEW_AND_EDIT,\n VISUALIZATION,\n DASHBOARD,\n EVENT_VISUALIZATION,\n INTERPRETATION,\n} from './constants.js' │ import {\n ACCESS_NONE,\n ACCESS_VIEW_ONLY,\n ACCESS_VIEW_AND_EDIT,\n VISUALIZATION,\n DASHBOARD,\n EVENT_VISUALIZATION,\n INTERPRETATION,\n} from './constants.js' │ import {\n ACCESS_NONE,\n ACCESS_VIEW_ONLY,\n ACCESS_VIEW_AND_EDIT,\n VISUALIZATION,\n DASHBOARD,\n EVENT_VISUALIZATION,\n INTERPRETATION,\n} from './constants.js'",<br/> "users": "objectOf"<br/>}|`{
|
|
1913
|
+
name: '',
|
|
1914
|
+
allowPublic: true,
|
|
1915
|
+
public: ACCESS_NONE,
|
|
1916
|
+
groups: {},
|
|
1917
|
+
users: {},
|
|
1918
|
+
}`||Used to seed the component with data to show whilst loading|
|
|
1770
1919
|
|onClose|function|`() => {}`|||
|
|
1771
1920
|
|onError|function|`() => {}`|||
|
|
1772
1921
|
|onSave|function|`() => {}`|||
|
|
@@ -1777,17 +1926,19 @@ INTERPRETATION,
|
|
|
1777
1926
|
|
|
1778
1927
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1779
1928
|
|
|
1929
|
+
|
|
1780
1930
|
```js
|
|
1781
1931
|
import { Modal } from '@dhis2/ui'
|
|
1782
1932
|
```
|
|
1783
1933
|
|
|
1934
|
+
|
|
1784
1935
|
#### Props
|
|
1785
1936
|
|
|
1786
|
-
|
|
|
1787
|
-
|
|
1788
|
-
|
|
|
1789
|
-
|
|
|
1790
|
-
|
|
|
1937
|
+
|Name|Type|Default|Required|Description|
|
|
1938
|
+
|---|---|---|---|---|
|
|
1939
|
+
|children|node||*||
|
|
1940
|
+
|name|string||||
|
|
1941
|
+
|onClose|function||||
|
|
1791
1942
|
|
|
1792
1943
|
### Switch
|
|
1793
1944
|
|
|
@@ -1795,32 +1946,34 @@ import { Modal } from '@dhis2/ui'
|
|
|
1795
1946
|
|
|
1796
1947
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1797
1948
|
|
|
1949
|
+
|
|
1798
1950
|
```js
|
|
1799
1951
|
import { Switch } from '@dhis2/ui'
|
|
1800
1952
|
```
|
|
1801
1953
|
|
|
1954
|
+
|
|
1802
1955
|
#### Props
|
|
1803
1956
|
|
|
1804
|
-
|
|
|
1805
|
-
|
|
1806
|
-
|
|
|
1807
|
-
|
|
|
1808
|
-
|
|
|
1809
|
-
|
|
|
1810
|
-
|
|
|
1811
|
-
|
|
|
1812
|
-
|
|
|
1813
|
-
|
|
|
1814
|
-
|
|
|
1815
|
-
|
|
|
1816
|
-
|
|
|
1817
|
-
|
|
|
1818
|
-
|
|
|
1819
|
-
|
|
|
1820
|
-
|
|
|
1821
|
-
|
|
|
1822
|
-
|
|
|
1823
|
-
|
|
|
1957
|
+
|Name|Type|Default|Required|Description|
|
|
1958
|
+
|---|---|---|---|---|
|
|
1959
|
+
|ariaLabel|string|||Sets an aria-label attribute on the input|
|
|
1960
|
+
|checked|boolean|`false`|||
|
|
1961
|
+
|className|string||||
|
|
1962
|
+
|dataTest|string|`'dhis2-uicore-switch'`|||
|
|
1963
|
+
|dense|boolean|||Makes the switch smaller for information-dense layouts|
|
|
1964
|
+
|disabled|boolean|||Disables the switch|
|
|
1965
|
+
|error|custom|||Applies 'error' styles for validation feedback. Mutually exclusive with `valid` and `warning` prop types|
|
|
1966
|
+
|initialFocus|boolean|||Grab initial focus on the page|
|
|
1967
|
+
|label|node|||Label for the switch. Can be a string or an element, for example an image|
|
|
1968
|
+
|name|string|||Name associated with the switch. Passed to event handlers in object|
|
|
1969
|
+
|role|string|`'switch'`||Sets a role attribute on the input|
|
|
1970
|
+
|tabIndex|string||||
|
|
1971
|
+
|valid|custom|||Applies 'valid' styles for validation feedback. Mutually exclusive with `error` and `warning` prop types|
|
|
1972
|
+
|value|string|||Value associated with the switch. Passed to event handlers in object|
|
|
1973
|
+
|warning|custom|||Applies 'warning' styles for validation feedback. Mutually exclusive with `valid` and `error` prop types|
|
|
1974
|
+
|onBlur|function|||Called with signature `({ name: string, value: string, checked: bool }, event)`|
|
|
1975
|
+
|onChange|function|||Called with signature `({ name: string, value: string, checked: bool }, event)`|
|
|
1976
|
+
|onFocus|function|||Called with signature `({ name: string, value: string, checked: bool }, event)`|
|
|
1824
1977
|
|
|
1825
1978
|
### SwitchField
|
|
1826
1979
|
|
|
@@ -1828,33 +1981,35 @@ import { Switch } from '@dhis2/ui'
|
|
|
1828
1981
|
|
|
1829
1982
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1830
1983
|
|
|
1984
|
+
|
|
1831
1985
|
```js
|
|
1832
1986
|
import { SwitchField } from '@dhis2/ui'
|
|
1833
1987
|
```
|
|
1834
1988
|
|
|
1989
|
+
|
|
1835
1990
|
#### Props
|
|
1836
1991
|
|
|
1837
|
-
|
|
|
1838
|
-
|
|
1839
|
-
|
|
|
1840
|
-
|
|
|
1841
|
-
|
|
|
1842
|
-
|
|
|
1843
|
-
|
|
|
1844
|
-
|
|
|
1845
|
-
|
|
|
1846
|
-
|
|
|
1847
|
-
|
|
|
1848
|
-
|
|
|
1849
|
-
|
|
|
1850
|
-
|
|
|
1851
|
-
|
|
|
1852
|
-
|
|
|
1853
|
-
|
|
|
1854
|
-
|
|
|
1855
|
-
|
|
|
1856
|
-
|
|
|
1857
|
-
|
|
|
1992
|
+
|Name|Type|Default|Required|Description|
|
|
1993
|
+
|---|---|---|---|---|
|
|
1994
|
+
|checked|boolean||||
|
|
1995
|
+
|className|string||||
|
|
1996
|
+
|dataTest|string|`'dhis2-uiwidgets-switchfield'`|||
|
|
1997
|
+
|dense|boolean|||Smaller dimensions for information-dense layouts|
|
|
1998
|
+
|disabled|boolean|||Disables the switch|
|
|
1999
|
+
|error|custom|||Applies 'error' styling to switch and validation text for feedback. Mutually exclusive with `warning` and `valid` props|
|
|
2000
|
+
|helpText|string|||Useful instructions for the user|
|
|
2001
|
+
|initialFocus|boolean||||
|
|
2002
|
+
|label|node|||Labels the switch|
|
|
2003
|
+
|name|string|||Name associate with the switch. Passed in object as argument to event handlers|
|
|
2004
|
+
|required|boolean|||Adds an asterisk to indicate this field is required|
|
|
2005
|
+
|tabIndex|string||||
|
|
2006
|
+
|valid|custom|||Applies 'valid' styling to switch and validation text for feedback. Mutually exclusive with `warning` and `error` props|
|
|
2007
|
+
|validationText|string|||Adds text below the switch to provide validation feedback. Acquires styles from `valid`, `warning` and `error` statuses|
|
|
2008
|
+
|value|string|||Value associated with the switch. Passed in object as argument to event handlers|
|
|
2009
|
+
|warning|custom|||Applies 'warning' styling to switch and validation text for feedback. Mutually exclusive with `valid` and `error` props|
|
|
2010
|
+
|onBlur|function|||Called with signature ({ name: string, value: string, checked: bool }, event)|
|
|
2011
|
+
|onChange|function|||Called with signature ({ name: string, value: string, checked: bool }, event)|
|
|
2012
|
+
|onFocus|function|||Called with signature ({ name: string, value: string, checked: bool }, event)|
|
|
1858
2013
|
|
|
1859
2014
|
### Tab
|
|
1860
2015
|
|
|
@@ -1862,21 +2017,23 @@ import { SwitchField } from '@dhis2/ui'
|
|
|
1862
2017
|
|
|
1863
2018
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1864
2019
|
|
|
2020
|
+
|
|
1865
2021
|
```js
|
|
1866
2022
|
import { Tab } from '@dhis2/ui'
|
|
1867
2023
|
```
|
|
1868
2024
|
|
|
2025
|
+
|
|
1869
2026
|
#### Props
|
|
1870
2027
|
|
|
1871
|
-
|
|
|
1872
|
-
|
|
1873
|
-
|
|
|
1874
|
-
|
|
|
1875
|
-
|
|
|
1876
|
-
|
|
|
1877
|
-
|
|
|
1878
|
-
|
|
|
1879
|
-
|
|
|
2028
|
+
|Name|Type|Default|Required|Description|
|
|
2029
|
+
|---|---|---|---|---|
|
|
2030
|
+
|children|node||||
|
|
2031
|
+
|className|string||||
|
|
2032
|
+
|dataTest|string|`'dhis2-uicore-tab'`|||
|
|
2033
|
+
|disabled|boolean||||
|
|
2034
|
+
|icon|element||||
|
|
2035
|
+
|selected|boolean|||Indicates this tab is selected|
|
|
2036
|
+
|onClick|function|||Called with the signature `({}, event)`|
|
|
1880
2037
|
|
|
1881
2038
|
### TabBar
|
|
1882
2039
|
|
|
@@ -1884,19 +2041,21 @@ import { Tab } from '@dhis2/ui'
|
|
|
1884
2041
|
|
|
1885
2042
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1886
2043
|
|
|
2044
|
+
|
|
1887
2045
|
```js
|
|
1888
2046
|
import { TabBar } from '@dhis2/ui'
|
|
1889
2047
|
```
|
|
1890
2048
|
|
|
2049
|
+
|
|
1891
2050
|
#### Props
|
|
1892
2051
|
|
|
1893
|
-
|
|
|
1894
|
-
|
|
1895
|
-
|
|
|
1896
|
-
|
|
|
1897
|
-
|
|
|
1898
|
-
|
|
|
1899
|
-
|
|
|
2052
|
+
|Name|Type|Default|Required|Description|
|
|
2053
|
+
|---|---|---|---|---|
|
|
2054
|
+
|children|node||||
|
|
2055
|
+
|className|string||||
|
|
2056
|
+
|dataTest|string|`'dhis2-uicore-tabbar'`|||
|
|
2057
|
+
|fixed|boolean|||Fixed tabs fill the width of their container. If false (i.e. fluid), tabs take up an amount of space defined by the tab name. Fluid tabs should be used most of the time.|
|
|
2058
|
+
|scrollable|boolean|||Enables horizontal scrolling for many tabs that don't fit the width of the container|
|
|
1900
2059
|
|
|
1901
2060
|
### DataTableCell
|
|
1902
2061
|
|
|
@@ -1904,34 +2063,37 @@ import { TabBar } from '@dhis2/ui'
|
|
|
1904
2063
|
|
|
1905
2064
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1906
2065
|
|
|
2066
|
+
|
|
1907
2067
|
```js
|
|
1908
2068
|
import { DataTableCell } from '@dhis2/ui'
|
|
1909
2069
|
```
|
|
1910
2070
|
|
|
2071
|
+
|
|
1911
2072
|
#### Props
|
|
1912
2073
|
|
|
1913
|
-
|
|
|
1914
|
-
|
|
1915
|
-
|
|
|
1916
|
-
|
|
|
1917
|
-
|
|
|
1918
|
-
|
|
|
1919
|
-
|
|
|
1920
|
-
|
|
|
1921
|
-
|
|
|
1922
|
-
|
|
|
1923
|
-
|
|
|
1924
|
-
|
|
|
1925
|
-
|
|
|
1926
|
-
|
|
|
1927
|
-
|
|
|
1928
|
-
|
|
|
1929
|
-
|
|
|
1930
|
-
|
|
|
1931
|
-
|
|
|
1932
|
-
|
|
|
1933
|
-
|
|
|
1934
|
-
|
|
|
2074
|
+
|Name|Type|Default|Required|Description|
|
|
2075
|
+
|---|---|---|---|---|
|
|
2076
|
+
|active|boolean|||To toggle border color, for example for editing|
|
|
2077
|
+
|align|'left' │ 'center' │ 'right'|`'left'`|||
|
|
2078
|
+
|backgroundColor|string|||Sets background color of the cell. Disables dynamic background colors from active, hover, and selected states|
|
|
2079
|
+
|bordered|boolean||||
|
|
2080
|
+
|children|node||||
|
|
2081
|
+
|className|string||||
|
|
2082
|
+
|colSpan|string||||
|
|
2083
|
+
|dataTest|string|`'dhis2-uicore-datatablecell'`|||
|
|
2084
|
+
|error|custom|||Mutually exclusive with muted and valid|
|
|
2085
|
+
|fixed|boolean|||When true a TableHeaderCell with sticky positioning will be rendered|
|
|
2086
|
+
|large|boolean||||
|
|
2087
|
+
|left|custom|`'auto'`||Required when fixed|
|
|
2088
|
+
|muted|custom|||Mutually exclusive with error and valid|
|
|
2089
|
+
|role|string||||
|
|
2090
|
+
|rowSpan|string||||
|
|
2091
|
+
|scope|string||||
|
|
2092
|
+
|staticStyle|boolean|||Surpress hover and active event styles|
|
|
2093
|
+
|tag|'td' │ 'th'|||Render a TableDataCell or TableHeaderCell respectively|
|
|
2094
|
+
|valid|custom|||Mutually exclusive with error and muted|
|
|
2095
|
+
|width|custom|`'auto'`||Required when fixed|
|
|
2096
|
+
|onClick|function||||
|
|
1935
2097
|
|
|
1936
2098
|
### DataTable
|
|
1937
2099
|
|
|
@@ -1939,22 +2101,24 @@ import { DataTableCell } from '@dhis2/ui'
|
|
|
1939
2101
|
|
|
1940
2102
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1941
2103
|
|
|
2104
|
+
|
|
1942
2105
|
```js
|
|
1943
2106
|
import { DataTable } from '@dhis2/ui'
|
|
1944
2107
|
```
|
|
1945
2108
|
|
|
2109
|
+
|
|
1946
2110
|
#### Props
|
|
1947
2111
|
|
|
1948
|
-
|
|
|
1949
|
-
|
|
1950
|
-
|
|
|
1951
|
-
|
|
|
1952
|
-
|
|
|
1953
|
-
|
|
|
1954
|
-
|
|
|
1955
|
-
|
|
|
1956
|
-
|
|
|
1957
|
-
|
|
|
2112
|
+
|Name|Type|Default|Required|Description|
|
|
2113
|
+
|---|---|---|---|---|
|
|
2114
|
+
|children|node|||Should be `<DataTableHead>`, `<DataTableBody>`, and `<DataTableFoot>` components|
|
|
2115
|
+
|className|string||||
|
|
2116
|
+
|dataTest|string|`'dhis2-uicore-datatable'`|||
|
|
2117
|
+
|layout|'auto' │ 'fixed' │ 'initial' │ 'inherit'|`'auto'`||Sets the `datatable-layout` property. Switching to `fixed` can prevent style<br/>issues when dealing with a datatable with multiple frozen columns or when dealing<br/>with filter elements in the datatable headers.|
|
|
2118
|
+
|role|string||||
|
|
2119
|
+
|scrollHeight|string|||Sets max-height of scrollbox|
|
|
2120
|
+
|scrollWidth|string|||Sets max-width of scrollbox|
|
|
2121
|
+
|width|string|`'100%'`||Sets the `width` property. Providing an explicit width can prevent style<br/>issues when dealing with horizontally scrolling datatables with a fixed layout.|
|
|
1958
2122
|
|
|
1959
2123
|
### StackedTableBody
|
|
1960
2124
|
|
|
@@ -1962,17 +2126,19 @@ import { DataTable } from '@dhis2/ui'
|
|
|
1962
2126
|
|
|
1963
2127
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1964
2128
|
|
|
2129
|
+
|
|
1965
2130
|
```js
|
|
1966
2131
|
import { StackedTableBody } from '@dhis2/ui'
|
|
1967
2132
|
```
|
|
1968
2133
|
|
|
2134
|
+
|
|
1969
2135
|
#### Props
|
|
1970
2136
|
|
|
1971
|
-
|
|
|
1972
|
-
|
|
1973
|
-
|
|
|
1974
|
-
|
|
|
1975
|
-
|
|
|
2137
|
+
|Name|Type|Default|Required|Description|
|
|
2138
|
+
|---|---|---|---|---|
|
|
2139
|
+
|children|node||||
|
|
2140
|
+
|className|string||||
|
|
2141
|
+
|dataTest|string|`'dhis2-uicore-stackedtablebody'`|||
|
|
1976
2142
|
|
|
1977
2143
|
### StackedTableCellHead
|
|
1978
2144
|
|
|
@@ -1980,19 +2146,21 @@ import { StackedTableBody } from '@dhis2/ui'
|
|
|
1980
2146
|
|
|
1981
2147
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
1982
2148
|
|
|
2149
|
+
|
|
1983
2150
|
```js
|
|
1984
2151
|
import { StackedTableCellHead } from '@dhis2/ui'
|
|
1985
2152
|
```
|
|
1986
2153
|
|
|
2154
|
+
|
|
1987
2155
|
#### Props
|
|
1988
2156
|
|
|
1989
|
-
|
|
|
1990
|
-
|
|
1991
|
-
|
|
|
1992
|
-
|
|
|
1993
|
-
|
|
|
1994
|
-
|
|
|
1995
|
-
|
|
|
2157
|
+
|Name|Type|Default|Required|Description|
|
|
2158
|
+
|---|---|---|---|---|
|
|
2159
|
+
|children|string|`''`|||
|
|
2160
|
+
|className|string||||
|
|
2161
|
+
|colSpan|string||||
|
|
2162
|
+
|dataTest|string|`'dhis2-uicore-stackedtablecellhead'`|||
|
|
2163
|
+
|rowSpan|string||||
|
|
1996
2164
|
|
|
1997
2165
|
### StackedTableCell
|
|
1998
2166
|
|
|
@@ -2000,23 +2168,25 @@ import { StackedTableCellHead } from '@dhis2/ui'
|
|
|
2000
2168
|
|
|
2001
2169
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2002
2170
|
|
|
2171
|
+
|
|
2003
2172
|
```js
|
|
2004
2173
|
import { StackedTableCell } from '@dhis2/ui'
|
|
2005
2174
|
```
|
|
2006
2175
|
|
|
2176
|
+
|
|
2007
2177
|
#### Props
|
|
2008
2178
|
|
|
2009
|
-
|
|
|
2010
|
-
|
|
2011
|
-
|
|
|
2012
|
-
|
|
|
2013
|
-
|
|
|
2014
|
-
|
|
|
2015
|
-
|
|
|
2016
|
-
|
|
|
2017
|
-
|
|
|
2018
|
-
|
|
|
2019
|
-
|
|
|
2179
|
+
|Name|Type|Default|Required|Description|
|
|
2180
|
+
|---|---|---|---|---|
|
|
2181
|
+
|children|node||||
|
|
2182
|
+
|className|string||||
|
|
2183
|
+
|colSpan|string||||
|
|
2184
|
+
|column|number||||
|
|
2185
|
+
|dataTest|string|`'dhis2-uicore-stackedtablecell'`|||
|
|
2186
|
+
|headerLabels|arrayOf(string)|`[]`|||
|
|
2187
|
+
|hideTitle|boolean||||
|
|
2188
|
+
|rowSpan|string||||
|
|
2189
|
+
|title|string||||
|
|
2020
2190
|
|
|
2021
2191
|
### StackedTableFoot
|
|
2022
2192
|
|
|
@@ -2024,17 +2194,19 @@ import { StackedTableCell } from '@dhis2/ui'
|
|
|
2024
2194
|
|
|
2025
2195
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2026
2196
|
|
|
2197
|
+
|
|
2027
2198
|
```js
|
|
2028
2199
|
import { StackedTableFoot } from '@dhis2/ui'
|
|
2029
2200
|
```
|
|
2030
2201
|
|
|
2202
|
+
|
|
2031
2203
|
#### Props
|
|
2032
2204
|
|
|
2033
|
-
|
|
|
2034
|
-
|
|
2035
|
-
|
|
|
2036
|
-
|
|
|
2037
|
-
|
|
|
2205
|
+
|Name|Type|Default|Required|Description|
|
|
2206
|
+
|---|---|---|---|---|
|
|
2207
|
+
|children|node||||
|
|
2208
|
+
|className|string||||
|
|
2209
|
+
|dataTest|string|`'dhis2-uicore-stackedtablefoot'`|||
|
|
2038
2210
|
|
|
2039
2211
|
### StackedTableHead
|
|
2040
2212
|
|
|
@@ -2042,17 +2214,19 @@ import { StackedTableFoot } from '@dhis2/ui'
|
|
|
2042
2214
|
|
|
2043
2215
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2044
2216
|
|
|
2217
|
+
|
|
2045
2218
|
```js
|
|
2046
2219
|
import { StackedTableHead } from '@dhis2/ui'
|
|
2047
2220
|
```
|
|
2048
2221
|
|
|
2222
|
+
|
|
2049
2223
|
#### Props
|
|
2050
2224
|
|
|
2051
|
-
|
|
|
2052
|
-
|
|
2053
|
-
|
|
|
2054
|
-
|
|
|
2055
|
-
|
|
|
2225
|
+
|Name|Type|Default|Required|Description|
|
|
2226
|
+
|---|---|---|---|---|
|
|
2227
|
+
|children|node||||
|
|
2228
|
+
|className|string||||
|
|
2229
|
+
|dataTest|string|`'dhis2-uicore-stackedtablehead'`|||
|
|
2056
2230
|
|
|
2057
2231
|
### StackedTableRowHead
|
|
2058
2232
|
|
|
@@ -2060,17 +2234,19 @@ import { StackedTableHead } from '@dhis2/ui'
|
|
|
2060
2234
|
|
|
2061
2235
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2062
2236
|
|
|
2237
|
+
|
|
2063
2238
|
```js
|
|
2064
2239
|
import { StackedTableRowHead } from '@dhis2/ui'
|
|
2065
2240
|
```
|
|
2066
2241
|
|
|
2242
|
+
|
|
2067
2243
|
#### Props
|
|
2068
2244
|
|
|
2069
|
-
|
|
|
2070
|
-
|
|
2071
|
-
|
|
|
2072
|
-
|
|
|
2073
|
-
|
|
|
2245
|
+
|Name|Type|Default|Required|Description|
|
|
2246
|
+
|---|---|---|---|---|
|
|
2247
|
+
|children|node||||
|
|
2248
|
+
|className|string||||
|
|
2249
|
+
|dataTest|string|`'dhis2-uicore-stackedtablerowhead'`|||
|
|
2074
2250
|
|
|
2075
2251
|
### StackedTableRow
|
|
2076
2252
|
|
|
@@ -2078,17 +2254,19 @@ import { StackedTableRowHead } from '@dhis2/ui'
|
|
|
2078
2254
|
|
|
2079
2255
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2080
2256
|
|
|
2257
|
+
|
|
2081
2258
|
```js
|
|
2082
2259
|
import { StackedTableRow } from '@dhis2/ui'
|
|
2083
2260
|
```
|
|
2084
2261
|
|
|
2262
|
+
|
|
2085
2263
|
#### Props
|
|
2086
2264
|
|
|
2087
|
-
|
|
|
2088
|
-
|
|
2089
|
-
|
|
|
2090
|
-
|
|
|
2091
|
-
|
|
|
2265
|
+
|Name|Type|Default|Required|Description|
|
|
2266
|
+
|---|---|---|---|---|
|
|
2267
|
+
|children|node||||
|
|
2268
|
+
|className|string||||
|
|
2269
|
+
|dataTest|string|`'dhis2-uicore-stackedtablerow'`|||
|
|
2092
2270
|
|
|
2093
2271
|
### StackedTable
|
|
2094
2272
|
|
|
@@ -2096,18 +2274,20 @@ import { StackedTableRow } from '@dhis2/ui'
|
|
|
2096
2274
|
|
|
2097
2275
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2098
2276
|
|
|
2277
|
+
|
|
2099
2278
|
```js
|
|
2100
2279
|
import { StackedTable } from '@dhis2/ui'
|
|
2101
2280
|
```
|
|
2102
2281
|
|
|
2282
|
+
|
|
2103
2283
|
#### Props
|
|
2104
2284
|
|
|
2105
|
-
|
|
|
2106
|
-
|
|
2107
|
-
|
|
|
2108
|
-
|
|
|
2109
|
-
|
|
|
2110
|
-
|
|
|
2285
|
+
|Name|Type|Default|Required|Description|
|
|
2286
|
+
|---|---|---|---|---|
|
|
2287
|
+
|children|node||||
|
|
2288
|
+
|className|string||||
|
|
2289
|
+
|dataTest|string|`'dhis2-uicore-stackedtable'`|||
|
|
2290
|
+
|headerLabels|arrayOf(string)|||Labels for columns. Use an empty string for a column without a header.|
|
|
2111
2291
|
|
|
2112
2292
|
### Table
|
|
2113
2293
|
|
|
@@ -2115,17 +2295,19 @@ import { StackedTable } from '@dhis2/ui'
|
|
|
2115
2295
|
|
|
2116
2296
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2117
2297
|
|
|
2298
|
+
|
|
2118
2299
|
```js
|
|
2119
2300
|
import { Table } from '@dhis2/ui'
|
|
2120
2301
|
```
|
|
2121
2302
|
|
|
2303
|
+
|
|
2122
2304
|
#### Props
|
|
2123
2305
|
|
|
2124
|
-
|
|
|
2125
|
-
|
|
2126
|
-
|
|
|
2127
|
-
|
|
|
2128
|
-
|
|
|
2306
|
+
|Name|Type|Default|Required|Description|
|
|
2307
|
+
|---|---|---|---|---|
|
|
2308
|
+
|children|node||*||
|
|
2309
|
+
|className|string||||
|
|
2310
|
+
|dataTest|string||||
|
|
2129
2311
|
|
|
2130
2312
|
### TableBody
|
|
2131
2313
|
|
|
@@ -2133,18 +2315,20 @@ import { Table } from '@dhis2/ui'
|
|
|
2133
2315
|
|
|
2134
2316
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2135
2317
|
|
|
2318
|
+
|
|
2136
2319
|
```js
|
|
2137
2320
|
import { TableBody } from '@dhis2/ui'
|
|
2138
2321
|
```
|
|
2139
2322
|
|
|
2323
|
+
|
|
2140
2324
|
#### Props
|
|
2141
2325
|
|
|
2142
|
-
|
|
|
2143
|
-
|
|
2144
|
-
|
|
|
2145
|
-
|
|
|
2146
|
-
|
|
|
2147
|
-
|
|
|
2326
|
+
|Name|Type|Default|Required|Description|
|
|
2327
|
+
|---|---|---|---|---|
|
|
2328
|
+
|children|node|||Should be `<TableRow>` components|
|
|
2329
|
+
|className|string||||
|
|
2330
|
+
|dataTest|string|`'dhis2-uicore-tablebody'`|||
|
|
2331
|
+
|role|string||||
|
|
2148
2332
|
|
|
2149
2333
|
### TableCellHead
|
|
2150
2334
|
|
|
@@ -2152,21 +2336,23 @@ import { TableBody } from '@dhis2/ui'
|
|
|
2152
2336
|
|
|
2153
2337
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2154
2338
|
|
|
2339
|
+
|
|
2155
2340
|
```js
|
|
2156
2341
|
import { TableCellHead } from '@dhis2/ui'
|
|
2157
2342
|
```
|
|
2158
2343
|
|
|
2344
|
+
|
|
2159
2345
|
#### Props
|
|
2160
2346
|
|
|
2161
|
-
|
|
|
2162
|
-
|
|
2163
|
-
|
|
|
2164
|
-
|
|
|
2165
|
-
|
|
|
2166
|
-
|
|
|
2167
|
-
|
|
|
2168
|
-
|
|
|
2169
|
-
|
|
|
2347
|
+
|Name|Type|Default|Required|Description|
|
|
2348
|
+
|---|---|---|---|---|
|
|
2349
|
+
|children|node||||
|
|
2350
|
+
|className|string||||
|
|
2351
|
+
|colSpan|string||||
|
|
2352
|
+
|dataTest|string|`'dhis2-uicore-tablecellhead'`|||
|
|
2353
|
+
|dense|boolean|||Uses less padding and height for information-dense layouts|
|
|
2354
|
+
|role|string||||
|
|
2355
|
+
|rowSpan|string||||
|
|
2170
2356
|
|
|
2171
2357
|
### TableCell
|
|
2172
2358
|
|
|
@@ -2174,21 +2360,23 @@ import { TableCellHead } from '@dhis2/ui'
|
|
|
2174
2360
|
|
|
2175
2361
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2176
2362
|
|
|
2363
|
+
|
|
2177
2364
|
```js
|
|
2178
2365
|
import { TableCell } from '@dhis2/ui'
|
|
2179
2366
|
```
|
|
2180
2367
|
|
|
2368
|
+
|
|
2181
2369
|
#### Props
|
|
2182
2370
|
|
|
2183
|
-
|
|
|
2184
|
-
|
|
2185
|
-
|
|
|
2186
|
-
|
|
|
2187
|
-
|
|
|
2188
|
-
|
|
|
2189
|
-
|
|
|
2190
|
-
|
|
|
2191
|
-
|
|
|
2371
|
+
|Name|Type|Default|Required|Description|
|
|
2372
|
+
|---|---|---|---|---|
|
|
2373
|
+
|children|node||||
|
|
2374
|
+
|className|string||||
|
|
2375
|
+
|colSpan|string||||
|
|
2376
|
+
|dataTest|string|`'dhis2-uicore-tablecell'`|||
|
|
2377
|
+
|dense|boolean|||Usees less padding and height for information-dense layouts|
|
|
2378
|
+
|role|string||||
|
|
2379
|
+
|rowSpan|string||||
|
|
2192
2380
|
|
|
2193
2381
|
### TableFoot
|
|
2194
2382
|
|
|
@@ -2196,18 +2384,20 @@ import { TableCell } from '@dhis2/ui'
|
|
|
2196
2384
|
|
|
2197
2385
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2198
2386
|
|
|
2387
|
+
|
|
2199
2388
|
```js
|
|
2200
2389
|
import { TableFoot } from '@dhis2/ui'
|
|
2201
2390
|
```
|
|
2202
2391
|
|
|
2392
|
+
|
|
2203
2393
|
#### Props
|
|
2204
2394
|
|
|
2205
|
-
|
|
|
2206
|
-
|
|
2207
|
-
|
|
|
2208
|
-
|
|
|
2209
|
-
|
|
|
2210
|
-
|
|
|
2395
|
+
|Name|Type|Default|Required|Description|
|
|
2396
|
+
|---|---|---|---|---|
|
|
2397
|
+
|children|node|||Should be `<TableRow>` components|
|
|
2398
|
+
|className|string||||
|
|
2399
|
+
|dataTest|string|`'dhis2-uicore-tablefoot'`|||
|
|
2400
|
+
|role|string||||
|
|
2211
2401
|
|
|
2212
2402
|
### TableHead
|
|
2213
2403
|
|
|
@@ -2215,18 +2405,20 @@ import { TableFoot } from '@dhis2/ui'
|
|
|
2215
2405
|
|
|
2216
2406
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2217
2407
|
|
|
2408
|
+
|
|
2218
2409
|
```js
|
|
2219
2410
|
import { TableHead } from '@dhis2/ui'
|
|
2220
2411
|
```
|
|
2221
2412
|
|
|
2413
|
+
|
|
2222
2414
|
#### Props
|
|
2223
2415
|
|
|
2224
|
-
|
|
|
2225
|
-
|
|
2226
|
-
|
|
|
2227
|
-
|
|
|
2228
|
-
|
|
|
2229
|
-
|
|
|
2416
|
+
|Name|Type|Default|Required|Description|
|
|
2417
|
+
|---|---|---|---|---|
|
|
2418
|
+
|children|node|||Should be `<TableRowHead>` components|
|
|
2419
|
+
|className|string||||
|
|
2420
|
+
|dataTest|string|`'dhis2-uicore-tablehead'`|||
|
|
2421
|
+
|role|string||||
|
|
2230
2422
|
|
|
2231
2423
|
### TableRowHead
|
|
2232
2424
|
|
|
@@ -2234,19 +2426,21 @@ import { TableHead } from '@dhis2/ui'
|
|
|
2234
2426
|
|
|
2235
2427
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2236
2428
|
|
|
2429
|
+
|
|
2237
2430
|
```js
|
|
2238
2431
|
import { TableRowHead } from '@dhis2/ui'
|
|
2239
2432
|
```
|
|
2240
2433
|
|
|
2434
|
+
|
|
2241
2435
|
#### Props
|
|
2242
2436
|
|
|
2243
|
-
|
|
|
2244
|
-
|
|
2245
|
-
|
|
|
2246
|
-
|
|
|
2247
|
-
|
|
|
2248
|
-
|
|
|
2249
|
-
|
|
|
2437
|
+
|Name|Type|Default|Required|Description|
|
|
2438
|
+
|---|---|---|---|---|
|
|
2439
|
+
|children|node|||Should be `<TableCellHead>` components|
|
|
2440
|
+
|className|string||||
|
|
2441
|
+
|dataTest|string|`'dhis2-uicore-tablerowhead'`|||
|
|
2442
|
+
|role|string||||
|
|
2443
|
+
|suppressZebraStriping|boolean|||Disables the default row striping for this row|
|
|
2250
2444
|
|
|
2251
2445
|
### TableRow
|
|
2252
2446
|
|
|
@@ -2254,19 +2448,21 @@ import { TableRowHead } from '@dhis2/ui'
|
|
|
2254
2448
|
|
|
2255
2449
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2256
2450
|
|
|
2451
|
+
|
|
2257
2452
|
```js
|
|
2258
2453
|
import { TableRow } from '@dhis2/ui'
|
|
2259
2454
|
```
|
|
2260
2455
|
|
|
2456
|
+
|
|
2261
2457
|
#### Props
|
|
2262
2458
|
|
|
2263
|
-
|
|
|
2264
|
-
|
|
2265
|
-
|
|
|
2266
|
-
|
|
|
2267
|
-
|
|
|
2268
|
-
|
|
|
2269
|
-
|
|
|
2459
|
+
|Name|Type|Default|Required|Description|
|
|
2460
|
+
|---|---|---|---|---|
|
|
2461
|
+
|children|node|||Should be `<TableCell>` or `<TableCellHead>` components|
|
|
2462
|
+
|className|string||||
|
|
2463
|
+
|dataTest|string|`'dhis2-uicore-tablerow'`|||
|
|
2464
|
+
|role|string||||
|
|
2465
|
+
|suppressZebraStriping|boolean|||Disables the default row striping for this row|
|
|
2270
2466
|
|
|
2271
2467
|
### Table
|
|
2272
2468
|
|
|
@@ -2274,19 +2470,21 @@ import { TableRow } from '@dhis2/ui'
|
|
|
2274
2470
|
|
|
2275
2471
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2276
2472
|
|
|
2473
|
+
|
|
2277
2474
|
```js
|
|
2278
2475
|
import { Table } from '@dhis2/ui'
|
|
2279
2476
|
```
|
|
2280
2477
|
|
|
2478
|
+
|
|
2281
2479
|
#### Props
|
|
2282
2480
|
|
|
2283
|
-
|
|
|
2284
|
-
|
|
2285
|
-
|
|
|
2286
|
-
|
|
|
2287
|
-
|
|
|
2288
|
-
|
|
|
2289
|
-
|
|
|
2481
|
+
|Name|Type|Default|Required|Description|
|
|
2482
|
+
|---|---|---|---|---|
|
|
2483
|
+
|children|node|||Should be `<TableHead>`, `<TableBody>`, and `<TableFoot>` components|
|
|
2484
|
+
|className|string||||
|
|
2485
|
+
|dataTest|string|`'dhis2-uicore-table'`|||
|
|
2486
|
+
|role|string||||
|
|
2487
|
+
|suppressZebraStriping|boolean|||Remove the default striping on alternating rows|
|
|
2290
2488
|
|
|
2291
2489
|
### DataTableColumnHeader
|
|
2292
2490
|
|
|
@@ -2294,34 +2492,36 @@ import { Table } from '@dhis2/ui'
|
|
|
2294
2492
|
|
|
2295
2493
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2296
2494
|
|
|
2495
|
+
|
|
2297
2496
|
```js
|
|
2298
2497
|
import { DataTableColumnHeader } from '@dhis2/ui'
|
|
2299
2498
|
```
|
|
2300
2499
|
|
|
2500
|
+
|
|
2301
2501
|
#### Props
|
|
2302
2502
|
|
|
2303
|
-
|
|
|
2304
|
-
|
|
2305
|
-
|
|
|
2306
|
-
|
|
|
2307
|
-
|
|
|
2308
|
-
|
|
|
2309
|
-
|
|
|
2310
|
-
|
|
|
2311
|
-
|
|
|
2312
|
-
|
|
|
2313
|
-
|
|
|
2314
|
-
|
|
|
2315
|
-
|
|
|
2316
|
-
|
|
|
2317
|
-
|
|
|
2318
|
-
|
|
|
2319
|
-
|
|
|
2320
|
-
|
|
|
2321
|
-
|
|
|
2322
|
-
|
|
|
2323
|
-
|
|
|
2324
|
-
|
|
|
2503
|
+
|Name|Type|Default|Required|Description|
|
|
2504
|
+
|---|---|---|---|---|
|
|
2505
|
+
|align|'left' │ 'center' │ 'right'||||
|
|
2506
|
+
|children|node||||
|
|
2507
|
+
|className|string||||
|
|
2508
|
+
|colSpan|string||||
|
|
2509
|
+
|dataTest|string|`'dhis2-uicore-datatablecellhead'`|||
|
|
2510
|
+
|filter|custom|||The filter element (JSX), required when onFilterIconClick or showFilter are present|
|
|
2511
|
+
|fixed|boolean||||
|
|
2512
|
+
|large|boolean||||
|
|
2513
|
+
|left|custom|||Left or top required when fixed|
|
|
2514
|
+
|name|string|||Can be used to match a column with a property name|
|
|
2515
|
+
|role|string||||
|
|
2516
|
+
|rowSpan|string||||
|
|
2517
|
+
|scope|string||||
|
|
2518
|
+
|showFilter|custom||||
|
|
2519
|
+
|sortDirection|custom||||
|
|
2520
|
+
|sortIconTitle|string||||
|
|
2521
|
+
|top|custom|||Left or top required when fixed|
|
|
2522
|
+
|width|string||||
|
|
2523
|
+
|onFilterIconClick|custom||||
|
|
2524
|
+
|onSortIconClick|custom|||Sort icon click callback with `nextSortDirection` and `name` in payload|
|
|
2325
2525
|
|
|
2326
2526
|
### DataTableRow
|
|
2327
2527
|
|
|
@@ -2329,23 +2529,25 @@ import { DataTableColumnHeader } from '@dhis2/ui'
|
|
|
2329
2529
|
|
|
2330
2530
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2331
2531
|
|
|
2532
|
+
|
|
2332
2533
|
```js
|
|
2333
2534
|
import { DataTableRow } from '@dhis2/ui'
|
|
2334
2535
|
```
|
|
2335
2536
|
|
|
2537
|
+
|
|
2336
2538
|
#### Props
|
|
2337
2539
|
|
|
2338
|
-
|
|
|
2339
|
-
|
|
2340
|
-
|
|
|
2341
|
-
|
|
|
2342
|
-
|
|
|
2343
|
-
|
|
|
2344
|
-
|
|
|
2345
|
-
|
|
|
2346
|
-
|
|
|
2347
|
-
|
|
|
2348
|
-
|
|
|
2540
|
+
|Name|Type|Default|Required|Description|
|
|
2541
|
+
|---|---|---|---|---|
|
|
2542
|
+
|children|node|||Should be `<DataTableCell>` or `<DataTableCellHead>` components|
|
|
2543
|
+
|className|string||||
|
|
2544
|
+
|dataTest|string|`'dhis2-uicore-datatablerow'`|||
|
|
2545
|
+
|draggable|boolean|||Renders and additional table cell with drag icon and applies draggable styles|
|
|
2546
|
+
|expandableContent|custom|||This content will be rendered into an additional row with fullwidth cell and the presence of this prop will display an additional table cell with expand icon|
|
|
2547
|
+
|expanded|boolean|||Toggles expand icon (up/down) and expandable content visibility|
|
|
2548
|
+
|role|string||||
|
|
2549
|
+
|selected|boolean|||Adds a green background color|
|
|
2550
|
+
|onExpandToggle|custom|||Callback for expand icon cell clicks|
|
|
2349
2551
|
|
|
2350
2552
|
### TableBody
|
|
2351
2553
|
|
|
@@ -2353,19 +2555,21 @@ import { DataTableRow } from '@dhis2/ui'
|
|
|
2353
2555
|
|
|
2354
2556
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2355
2557
|
|
|
2558
|
+
|
|
2356
2559
|
```js
|
|
2357
2560
|
import { TableBody } from '@dhis2/ui'
|
|
2358
2561
|
```
|
|
2359
2562
|
|
|
2563
|
+
|
|
2360
2564
|
#### Props
|
|
2361
2565
|
|
|
2362
|
-
|
|
|
2363
|
-
|
|
2364
|
-
|
|
|
2365
|
-
|
|
|
2366
|
-
|
|
|
2367
|
-
|
|
|
2368
|
-
|
|
|
2566
|
+
|Name|Type|Default|Required|Description|
|
|
2567
|
+
|---|---|---|---|---|
|
|
2568
|
+
|children|node|||Should be `<TableRow>` components|
|
|
2569
|
+
|className|string||||
|
|
2570
|
+
|dataTest|string|`'dhis2-uicore-tablebody'`|||
|
|
2571
|
+
|loading|boolean||||
|
|
2572
|
+
|role|string||||
|
|
2369
2573
|
|
|
2370
2574
|
### TableFoot
|
|
2371
2575
|
|
|
@@ -2373,18 +2577,20 @@ import { TableBody } from '@dhis2/ui'
|
|
|
2373
2577
|
|
|
2374
2578
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2375
2579
|
|
|
2580
|
+
|
|
2376
2581
|
```js
|
|
2377
2582
|
import { TableFoot } from '@dhis2/ui'
|
|
2378
2583
|
```
|
|
2379
2584
|
|
|
2585
|
+
|
|
2380
2586
|
#### Props
|
|
2381
2587
|
|
|
2382
|
-
|
|
|
2383
|
-
|
|
2384
|
-
|
|
|
2385
|
-
|
|
|
2386
|
-
|
|
|
2387
|
-
|
|
|
2588
|
+
|Name|Type|Default|Required|Description|
|
|
2589
|
+
|---|---|---|---|---|
|
|
2590
|
+
|children|node|||Should be `<TableRow>` components|
|
|
2591
|
+
|className|string||||
|
|
2592
|
+
|dataTest|string|`'dhis2-uicore-tablefoot'`|||
|
|
2593
|
+
|role|string||||
|
|
2388
2594
|
|
|
2389
2595
|
### TableHead
|
|
2390
2596
|
|
|
@@ -2392,18 +2598,20 @@ import { TableFoot } from '@dhis2/ui'
|
|
|
2392
2598
|
|
|
2393
2599
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2394
2600
|
|
|
2601
|
+
|
|
2395
2602
|
```js
|
|
2396
2603
|
import { TableHead } from '@dhis2/ui'
|
|
2397
2604
|
```
|
|
2398
2605
|
|
|
2606
|
+
|
|
2399
2607
|
#### Props
|
|
2400
2608
|
|
|
2401
|
-
|
|
|
2402
|
-
|
|
2403
|
-
|
|
|
2404
|
-
|
|
|
2405
|
-
|
|
|
2406
|
-
|
|
|
2609
|
+
|Name|Type|Default|Required|Description|
|
|
2610
|
+
|---|---|---|---|---|
|
|
2611
|
+
|children|node|||Should be `<TableRowHead>` components|
|
|
2612
|
+
|className|string||||
|
|
2613
|
+
|dataTest|string|`'dhis2-uicore-tablehead'`|||
|
|
2614
|
+
|role|string||||
|
|
2407
2615
|
|
|
2408
2616
|
### TableRow
|
|
2409
2617
|
|
|
@@ -2411,20 +2619,22 @@ import { TableHead } from '@dhis2/ui'
|
|
|
2411
2619
|
|
|
2412
2620
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2413
2621
|
|
|
2622
|
+
|
|
2414
2623
|
```js
|
|
2415
2624
|
import { TableRow } from '@dhis2/ui'
|
|
2416
2625
|
```
|
|
2417
2626
|
|
|
2627
|
+
|
|
2418
2628
|
#### Props
|
|
2419
2629
|
|
|
2420
|
-
|
|
|
2421
|
-
|
|
2422
|
-
|
|
|
2423
|
-
|
|
|
2424
|
-
|
|
|
2425
|
-
|
|
|
2426
|
-
|
|
|
2427
|
-
|
|
|
2630
|
+
|Name|Type|Default|Required|Description|
|
|
2631
|
+
|---|---|---|---|---|
|
|
2632
|
+
|children|node|||Should be `<TableDataCell>` or `<TableDataCellHead>` components|
|
|
2633
|
+
|className|string||||
|
|
2634
|
+
|dataTest|string|`'dhis2-uicore-tablerow'`|||
|
|
2635
|
+
|draggable|boolean|||Applies draggable cursor styles|
|
|
2636
|
+
|role|string||||
|
|
2637
|
+
|selected|boolean|||Sets a selected (teal) background color|
|
|
2428
2638
|
|
|
2429
2639
|
### Table
|
|
2430
2640
|
|
|
@@ -2432,21 +2642,23 @@ import { TableRow } from '@dhis2/ui'
|
|
|
2432
2642
|
|
|
2433
2643
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2434
2644
|
|
|
2645
|
+
|
|
2435
2646
|
```js
|
|
2436
2647
|
import { Table } from '@dhis2/ui'
|
|
2437
2648
|
```
|
|
2438
2649
|
|
|
2650
|
+
|
|
2439
2651
|
#### Props
|
|
2440
2652
|
|
|
2441
|
-
|
|
|
2442
|
-
|
|
2443
|
-
|
|
|
2444
|
-
|
|
|
2445
|
-
|
|
|
2446
|
-
|
|
|
2447
|
-
|
|
|
2448
|
-
|
|
|
2449
|
-
|
|
|
2653
|
+
|Name|Type|Default|Required|Description|
|
|
2654
|
+
|---|---|---|---|---|
|
|
2655
|
+
|borderless|boolean|||Removes border from the table|
|
|
2656
|
+
|children|node|||Should be `<TableHead>`, `<TableBody>`, and `<TableFoot>` components|
|
|
2657
|
+
|className|string||||
|
|
2658
|
+
|dataTest|string|`'dhis2-uicore-table'`|||
|
|
2659
|
+
|layout|'auto' │ 'fixed' │ 'initial' │ 'inherit'|`'auto'`||Sets the `table-layout` property. Switching to `fixed` can prevent style<br/>issues when dealing with a table with multiple frozen columns or when dealing<br/>with filter elements in the table headers.|
|
|
2660
|
+
|role|string||||
|
|
2661
|
+
|width|string|`'100%'`||Sets the `width` property. Providing an explicit width can prevent style<br/>issues when dealing with horizontally scrolling tables with a fixed layout.|
|
|
2450
2662
|
|
|
2451
2663
|
### Tag
|
|
2452
2664
|
|
|
@@ -2454,23 +2666,25 @@ import { Table } from '@dhis2/ui'
|
|
|
2454
2666
|
|
|
2455
2667
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2456
2668
|
|
|
2669
|
+
|
|
2457
2670
|
```js
|
|
2458
2671
|
import { Tag } from '@dhis2/ui'
|
|
2459
2672
|
```
|
|
2460
2673
|
|
|
2674
|
+
|
|
2461
2675
|
#### Props
|
|
2462
2676
|
|
|
2463
|
-
|
|
|
2464
|
-
|
|
2465
|
-
|
|
|
2466
|
-
|
|
|
2467
|
-
|
|
|
2468
|
-
|
|
|
2469
|
-
|
|
|
2470
|
-
|
|
|
2471
|
-
|
|
|
2472
|
-
|
|
|
2473
|
-
|
|
|
2677
|
+
|Name|Type|Default|Required|Description|
|
|
2678
|
+
|---|---|---|---|---|
|
|
2679
|
+
|bold|boolean|||Use bold tags where it is important that the tag is seen by the user in an information dense interface. Bold tags should be reserved for edge cases and not overused.|
|
|
2680
|
+
|children|string||||
|
|
2681
|
+
|className|string||||
|
|
2682
|
+
|dataTest|string|`'dhis2-uicore-tag'`|||
|
|
2683
|
+
|icon|node|||Tags can contain icons. Use icons where they will help users easily identify the content of the tag. Tags must have a text label and cannot display only an icon.|
|
|
2684
|
+
|maxWidth|string|`'240px'`|||
|
|
2685
|
+
|negative|custom|||Red 'negative' tags imply an error or a problem. `neutral`, `positive`, and `negative` are mutually exclusive props|
|
|
2686
|
+
|neutral|custom|||Blue 'neutral' tags are used when a tag _could_ have valid or error status but is currently neutral. `neutral`, `positive`, and `negative` are mutually exclusive props|
|
|
2687
|
+
|positive|custom|||Green 'valid' tags should be used to indicate validity or success. `neutral`, `positive`, and `negative` are mutually exclusive props|
|
|
2474
2688
|
|
|
2475
2689
|
### TextArea
|
|
2476
2690
|
|
|
@@ -2478,35 +2692,37 @@ import { Tag } from '@dhis2/ui'
|
|
|
2478
2692
|
|
|
2479
2693
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2480
2694
|
|
|
2695
|
+
|
|
2481
2696
|
```js
|
|
2482
2697
|
import { TextArea } from '@dhis2/ui'
|
|
2483
2698
|
```
|
|
2484
2699
|
|
|
2700
|
+
|
|
2485
2701
|
#### Props
|
|
2486
2702
|
|
|
2487
|
-
|
|
|
2488
|
-
|
|
2489
|
-
|
|
|
2490
|
-
|
|
|
2491
|
-
|
|
|
2492
|
-
|
|
|
2493
|
-
|
|
|
2494
|
-
|
|
|
2495
|
-
|
|
|
2496
|
-
|
|
|
2497
|
-
|
|
|
2498
|
-
|
|
|
2499
|
-
|
|
|
2500
|
-
|
|
|
2501
|
-
|
|
|
2502
|
-
|
|
|
2503
|
-
|
|
|
2504
|
-
|
|
|
2505
|
-
|
|
|
2506
|
-
|
|
|
2507
|
-
|
|
|
2508
|
-
|
|
|
2509
|
-
|
|
|
2703
|
+
|Name|Type|Default|Required|Description|
|
|
2704
|
+
|---|---|---|---|---|
|
|
2705
|
+
|autoGrow|boolean|||Grow the text area in response to overflow instead of adding a scroll bar|
|
|
2706
|
+
|className|string||||
|
|
2707
|
+
|dataTest|string|`'dhis2-uicore-textarea'`|||
|
|
2708
|
+
|dense|boolean|||Compact mode|
|
|
2709
|
+
|disabled|boolean|||Disables the textarea and makes in non-interactive|
|
|
2710
|
+
|error|custom|||Applies 'error' styles for validation feedback. Mutually exclusive with `valid` and `warning` props|
|
|
2711
|
+
|initialFocus|boolean|||Grabs initial focus on the page|
|
|
2712
|
+
|loading|boolean|||Adds a loading spinner|
|
|
2713
|
+
|name|string|||Name associated with the text area. Passed in object argument to event handlers.|
|
|
2714
|
+
|placeholder|string|||Placeholder text for an empty textarea|
|
|
2715
|
+
|readOnly|boolean|||Makes the textarea read-only|
|
|
2716
|
+
|resize|'none' │ 'both' │ 'horizontal' │ 'vertical'|`'vertical'`||[Resize property](https://developer.mozilla.org/en-US/docs/Web/CSS/resize) for the textarea element|
|
|
2717
|
+
|rows|number|`4`||Initial height of the textarea, in lines of text|
|
|
2718
|
+
|tabIndex|string||||
|
|
2719
|
+
|valid|custom|||Applies 'valid' styles for validation feedback. Mutually exclusive with `warning` and `error` props|
|
|
2720
|
+
|value|string|||Value in the textarea. Can be used to control component (recommended). Passed in object argument to event handlers.|
|
|
2721
|
+
|warning|custom|||Applies 'warning' styles for validation feedback. Mutually exclusive with `valid` and `error` props|
|
|
2722
|
+
|width|string|`'100%'`||Width of the text area. Can be any valid CSS measurement|
|
|
2723
|
+
|onBlur|function|||Called with signature ({ name: string, value: string }, event)|
|
|
2724
|
+
|onChange|function|||Called with signature ({ name: string, value: string }, event)|
|
|
2725
|
+
|onFocus|function|||Called with signature ({ name: string, value: string }, event)|
|
|
2510
2726
|
|
|
2511
2727
|
### TextAreaField
|
|
2512
2728
|
|
|
@@ -2514,39 +2730,41 @@ import { TextArea } from '@dhis2/ui'
|
|
|
2514
2730
|
|
|
2515
2731
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2516
2732
|
|
|
2733
|
+
|
|
2517
2734
|
```js
|
|
2518
2735
|
import { TextAreaField } from '@dhis2/ui'
|
|
2519
2736
|
```
|
|
2520
2737
|
|
|
2738
|
+
|
|
2521
2739
|
#### Props
|
|
2522
2740
|
|
|
2523
|
-
|
|
|
2524
|
-
|
|
2525
|
-
|
|
|
2526
|
-
|
|
|
2527
|
-
|
|
|
2528
|
-
|
|
|
2529
|
-
|
|
|
2530
|
-
|
|
|
2531
|
-
|
|
|
2532
|
-
|
|
|
2533
|
-
|
|
|
2534
|
-
|
|
|
2535
|
-
|
|
|
2536
|
-
|
|
|
2537
|
-
|
|
|
2538
|
-
|
|
|
2539
|
-
|
|
|
2540
|
-
|
|
|
2541
|
-
|
|
|
2542
|
-
|
|
|
2543
|
-
|
|
|
2544
|
-
|
|
|
2545
|
-
|
|
|
2546
|
-
|
|
|
2547
|
-
|
|
|
2548
|
-
|
|
|
2549
|
-
|
|
|
2741
|
+
|Name|Type|Default|Required|Description|
|
|
2742
|
+
|---|---|---|---|---|
|
|
2743
|
+
|autoGrow|boolean|||Grow the text area in response to overflow instead of adding a scroll bar|
|
|
2744
|
+
|className|string||||
|
|
2745
|
+
|dataTest|string|`'dhis2-uiwidgets-textareafield'`|||
|
|
2746
|
+
|dense|boolean|||Compact mode|
|
|
2747
|
+
|disabled|boolean|||Disables the textarea and makes in non-interactive|
|
|
2748
|
+
|error|custom|||Applies 'error' styles for validation feedback. Mutually exclusive with `valid` and `warning` props|
|
|
2749
|
+
|helpText|string|||Adds useful help text below the textarea|
|
|
2750
|
+
|initialFocus|boolean|||Grabs initial focus on the page|
|
|
2751
|
+
|inputWidth|string|||Sets the width of the textarea. Minimum 220px. Any valid CSS measurement can be used|
|
|
2752
|
+
|label|string|||Labels the textarea|
|
|
2753
|
+
|loading|boolean|||Adds a loading spinner|
|
|
2754
|
+
|name|string|||Name associated with the text area. Passed in object argument to event handlers.|
|
|
2755
|
+
|placeholder|string|||Placeholder text for an empty textarea|
|
|
2756
|
+
|readOnly|boolean|||Makes the textarea read-only|
|
|
2757
|
+
|required|boolean|||Adds an asterisk to the label to indicate this field is required|
|
|
2758
|
+
|resize|'none' │ 'both' │ 'horizontal' │ 'vertical'|`'vertical'`||[Resize property](https://developer.mozilla.org/en-US/docs/Web/CSS/resize) for the textarea element|
|
|
2759
|
+
|rows|number|`4`||Initial height of the textarea, in lines of text|
|
|
2760
|
+
|tabIndex|string||||
|
|
2761
|
+
|valid|custom|||Applies 'valid' styles for validation feedback. Mutually exclusive with `warning` and `error` props|
|
|
2762
|
+
|validationText|string|||Validation text below the textarea to provide validation feedback. Changes appearance depending on validation status|
|
|
2763
|
+
|value|string|||Value in the textarea. Can be used to control component (recommended). Passed in object argument to event handlers.|
|
|
2764
|
+
|warning|custom|||Applies 'warning' styles for validation feedback. Mutually exclusive with `valid` and `error` props|
|
|
2765
|
+
|onBlur|function|||Called with signature ({ name: string, value: string }, event)|
|
|
2766
|
+
|onChange|function|||Called with signature ({ name: string, value: string }, event)|
|
|
2767
|
+
|onFocus|function|||Called with signature ({ name: string, value: string }, event)|
|
|
2550
2768
|
|
|
2551
2769
|
### Tooltip
|
|
2552
2770
|
|
|
@@ -2554,22 +2772,24 @@ import { TextAreaField } from '@dhis2/ui'
|
|
|
2554
2772
|
|
|
2555
2773
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2556
2774
|
|
|
2775
|
+
|
|
2557
2776
|
```js
|
|
2558
2777
|
import { Tooltip } from '@dhis2/ui'
|
|
2559
2778
|
```
|
|
2560
2779
|
|
|
2780
|
+
|
|
2561
2781
|
#### Props
|
|
2562
2782
|
|
|
2563
|
-
|
|
|
2564
|
-
|
|
2565
|
-
|
|
|
2566
|
-
|
|
|
2567
|
-
|
|
|
2568
|
-
|
|
|
2569
|
-
|
|
|
2570
|
-
|
|
|
2571
|
-
|
|
|
2572
|
-
|
|
|
2783
|
+
|Name|Type|Default|Required|Description|
|
|
2784
|
+
|---|---|---|---|---|
|
|
2785
|
+
|children|node │ function|||If child is a function, it's called with `{ onMouseOver, onMouseOut, ref }` args to apply to a reference element. If child is a node, it is wrapped in a `span` with the appropriate attributes and handlers.|
|
|
2786
|
+
|className|string||||
|
|
2787
|
+
|closeDelay|number|`200`||Time (in ms) until tooltip closes after mouse out|
|
|
2788
|
+
|content|node|||Content to display when the tooltip is open|
|
|
2789
|
+
|dataTest|string|`'dhis2-uicore-tooltip'`|||
|
|
2790
|
+
|maxWidth|number|`300`||Max width of the tooltip in px|
|
|
2791
|
+
|openDelay|number|`200`||Time (in ms) until tooltip open after mouse over|
|
|
2792
|
+
|placement|'top' │ 'right' │ 'bottom' │ 'left'|`'top'`||Where to place the tooltip relative to its reference|
|
|
2573
2793
|
|
|
2574
2794
|
### TransferOption
|
|
2575
2795
|
|
|
@@ -2577,22 +2797,24 @@ import { Tooltip } from '@dhis2/ui'
|
|
|
2577
2797
|
|
|
2578
2798
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2579
2799
|
|
|
2800
|
+
|
|
2580
2801
|
```js
|
|
2581
2802
|
import { TransferOption } from '@dhis2/ui'
|
|
2582
2803
|
```
|
|
2583
2804
|
|
|
2805
|
+
|
|
2584
2806
|
#### Props
|
|
2585
2807
|
|
|
2586
|
-
|
|
|
2587
|
-
|
|
2588
|
-
|
|
|
2589
|
-
|
|
|
2590
|
-
|
|
|
2591
|
-
|
|
|
2592
|
-
|
|
|
2593
|
-
|
|
|
2594
|
-
|
|
|
2595
|
-
|
|
|
2808
|
+
|Name|Type|Default|Required|Description|
|
|
2809
|
+
|---|---|---|---|---|
|
|
2810
|
+
|label|node||*||
|
|
2811
|
+
|value|string||*||
|
|
2812
|
+
|className|string||||
|
|
2813
|
+
|dataTest|string|`'dhis2-uicore-transferoption'`|||
|
|
2814
|
+
|disabled|boolean||||
|
|
2815
|
+
|highlighted|boolean||||
|
|
2816
|
+
|onClick|function||||
|
|
2817
|
+
|onDoubleClick|function||||
|
|
2596
2818
|
|
|
2597
2819
|
### Transfer
|
|
2598
2820
|
|
|
@@ -2600,56 +2822,58 @@ import { TransferOption } from '@dhis2/ui'
|
|
|
2600
2822
|
|
|
2601
2823
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2602
2824
|
|
|
2825
|
+
|
|
2603
2826
|
```js
|
|
2604
2827
|
import { Transfer } from '@dhis2/ui'
|
|
2605
2828
|
```
|
|
2606
2829
|
|
|
2830
|
+
|
|
2607
2831
|
#### Props
|
|
2608
2832
|
|
|
2609
|
-
|
|
|
2610
|
-
|
|
2611
|
-
|
|
|
2612
|
-
|
|
|
2613
|
-
|
|
|
2614
|
-
|
|
|
2615
|
-
|
|
|
2616
|
-
|
|
|
2617
|
-
|
|
|
2618
|
-
|
|
|
2619
|
-
|
|
|
2620
|
-
|
|
|
2621
|
-
|
|
|
2622
|
-
|
|
|
2623
|
-
|
|
|
2624
|
-
|
|
|
2625
|
-
|
|
|
2626
|
-
|
|
|
2627
|
-
|
|
|
2628
|
-
|
|
|
2629
|
-
|
|
|
2630
|
-
|
|
|
2631
|
-
|
|
|
2632
|
-
|
|
|
2633
|
-
|
|
|
2634
|
-
|
|
|
2635
|
-
|
|
|
2636
|
-
|
|
|
2637
|
-
|
|
|
2638
|
-
|
|
|
2639
|
-
|
|
|
2640
|
-
|
|
|
2641
|
-
|
|
|
2642
|
-
|
|
|
2643
|
-
|
|
|
2644
|
-
|
|
|
2645
|
-
|
|
|
2646
|
-
|
|
|
2647
|
-
|
|
|
2648
|
-
|
|
|
2649
|
-
|
|
|
2650
|
-
|
|
|
2651
|
-
|
|
|
2652
|
-
|
|
|
2833
|
+
|Name|Type|Default|Required|Description|
|
|
2834
|
+
|---|---|---|---|---|
|
|
2835
|
+
|options|arrayOf({<br/> "label": "string",<br/> "value": "string",<br/> "disabled": "boolean"<br/>})||*||
|
|
2836
|
+
|onChange|function||*||
|
|
2837
|
+
|addAllText|string||||
|
|
2838
|
+
|addIndividualText|string||||
|
|
2839
|
+
|className|string||||
|
|
2840
|
+
|dataTest|string|`'dhis2-uicore-transfer'`|||
|
|
2841
|
+
|disabled|boolean||||
|
|
2842
|
+
|enableOrderChange|boolean||||
|
|
2843
|
+
|filterCallback|function|`defaultFilterCallback`|||
|
|
2844
|
+
|filterCallbackPicked|function|`defaultFilterCallback`|||
|
|
2845
|
+
|filterLabel|string||||
|
|
2846
|
+
|filterLabelPicked|string||||
|
|
2847
|
+
|filterPlaceholder|string||||
|
|
2848
|
+
|filterPlaceholderPicked|string||||
|
|
2849
|
+
|filterable|boolean||||
|
|
2850
|
+
|filterablePicked|boolean||||
|
|
2851
|
+
|height|string|`'240px'`|||
|
|
2852
|
+
|hideFilterInput|boolean||||
|
|
2853
|
+
|hideFilterInputPicked|boolean||||
|
|
2854
|
+
|initialSearchTerm|string|`''`|||
|
|
2855
|
+
|initialSearchTermPicked|string|`''`|||
|
|
2856
|
+
|leftFooter|node||||
|
|
2857
|
+
|leftHeader|node||||
|
|
2858
|
+
|loading|boolean||||
|
|
2859
|
+
|loadingPicked|boolean||||
|
|
2860
|
+
|maxSelections|1 │ Infinity|`Infinity`|||
|
|
2861
|
+
|optionsWidth|string|`'320px'`|||
|
|
2862
|
+
|removeAllText|string||||
|
|
2863
|
+
|removeIndividualText|string||||
|
|
2864
|
+
|renderOption|function|`(option) => <TransferOption {...option} />`|||
|
|
2865
|
+
|rightFooter|node||||
|
|
2866
|
+
|rightHeader|node||||
|
|
2867
|
+
|searchTerm|string||||
|
|
2868
|
+
|searchTermPicked|string||||
|
|
2869
|
+
|selected|arrayOf(string)|`[]`|||
|
|
2870
|
+
|selectedEmptyComponent|node||||
|
|
2871
|
+
|selectedWidth|string|`'320px'`|||
|
|
2872
|
+
|sourceEmptyPlaceholder|node||||
|
|
2873
|
+
|onEndReached|function||||
|
|
2874
|
+
|onEndReachedPicked|function||||
|
|
2875
|
+
|onFilterChange|function||||
|
|
2876
|
+
|onFilterChangePicked|function||||
|
|
2653
2877
|
|
|
2654
2878
|
### UserAvatar
|
|
2655
2879
|
|
|
@@ -2657,20 +2881,22 @@ import { Transfer } from '@dhis2/ui'
|
|
|
2657
2881
|
|
|
2658
2882
|
**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.
|
|
2659
2883
|
|
|
2884
|
+
|
|
2660
2885
|
```js
|
|
2661
2886
|
import { UserAvatar } from '@dhis2/ui'
|
|
2662
2887
|
```
|
|
2663
2888
|
|
|
2889
|
+
|
|
2664
2890
|
#### Props
|
|
2665
2891
|
|
|
2666
|
-
|
|
|
2667
|
-
|
|
2668
|
-
|
|
|
2669
|
-
|
|
|
2670
|
-
|
|
|
2671
|
-
|
|
|
2672
|
-
|
|
|
2673
|
-
|
|
|
2674
|
-
|
|
|
2675
|
-
|
|
|
2676
|
-
|
|
|
2892
|
+
|Name|Type|Default|Required|Description|
|
|
2893
|
+
|---|---|---|---|---|
|
|
2894
|
+
|name|string||*||
|
|
2895
|
+
|avatarId|string||||
|
|
2896
|
+
|className|string||||
|
|
2897
|
+
|dataTest|string|`'dhis2-uicore-useravatar'`|||
|
|
2898
|
+
|extralarge|custom||||
|
|
2899
|
+
|extrasmall|custom||||
|
|
2900
|
+
|large|custom||||
|
|
2901
|
+
|medium|custom||||
|
|
2902
|
+
|small|custom||||
|