@dhis2/ui 8.2.3 → 8.2.6

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