@dhis2-ui/select 10.12.3 → 10.12.5

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/package.json +15 -15
  2. package/types/index.d.ts +122 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/select",
3
- "version": "10.12.3",
3
+ "version": "10.12.5",
4
4
  "description": "UI Select",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,21 +33,21 @@
33
33
  "styled-jsx": "^4"
34
34
  },
35
35
  "dependencies": {
36
- "@dhis2-ui/box": "10.12.3",
37
- "@dhis2-ui/button": "10.12.3",
38
- "@dhis2-ui/card": "10.12.3",
39
- "@dhis2-ui/checkbox": "10.12.3",
40
- "@dhis2-ui/chip": "10.12.3",
41
- "@dhis2-ui/field": "10.12.3",
42
- "@dhis2-ui/input": "10.12.3",
43
- "@dhis2-ui/layer": "10.12.3",
44
- "@dhis2-ui/loader": "10.12.3",
45
- "@dhis2-ui/popper": "10.12.3",
46
- "@dhis2-ui/status-icon": "10.12.3",
47
- "@dhis2-ui/tooltip": "10.12.3",
36
+ "@dhis2-ui/box": "10.12.5",
37
+ "@dhis2-ui/button": "10.12.5",
38
+ "@dhis2-ui/card": "10.12.5",
39
+ "@dhis2-ui/checkbox": "10.12.5",
40
+ "@dhis2-ui/chip": "10.12.5",
41
+ "@dhis2-ui/field": "10.12.5",
42
+ "@dhis2-ui/input": "10.12.5",
43
+ "@dhis2-ui/layer": "10.12.5",
44
+ "@dhis2-ui/loader": "10.12.5",
45
+ "@dhis2-ui/popper": "10.12.5",
46
+ "@dhis2-ui/status-icon": "10.12.5",
47
+ "@dhis2-ui/tooltip": "10.12.5",
48
48
  "@dhis2/prop-types": "^3.1.2",
49
- "@dhis2/ui-constants": "10.12.3",
50
- "@dhis2/ui-icons": "10.12.3",
49
+ "@dhis2/ui-constants": "10.12.5",
50
+ "@dhis2/ui-icons": "10.12.5",
51
51
  "classnames": "^2.3.1",
52
52
  "prop-types": "^15.7.2"
53
53
  },
package/types/index.d.ts CHANGED
@@ -450,6 +450,128 @@ export interface SimpleSingleSelectProps {
450
450
 
451
451
  export const SimpleSingleSelect: React.FC<SimpleSingleSelectProps>
452
452
 
453
+ export interface SimpleSingleSelectFieldProps {
454
+ /** Label displayed above the input **/
455
+ label: string
456
+
457
+ /** necessary for IDs that are required for accessibility **/
458
+ name: string
459
+
460
+ /** An array of options **/
461
+ options: optionProp[]
462
+
463
+ /** A callback that will be called with the new value or an empty string **/
464
+ onChange: (value: string) => void
465
+
466
+ /** Will focus the select initially **/
467
+ autoFocus?: boolean
468
+
469
+ /** Additional class names that will be applied to the root element **/
470
+ className?: string
471
+
472
+ /** This will allow us to put an aria-label on the clear button **/
473
+ clearText?: string
474
+
475
+ /** Whether a clear button should be displayed or not **/
476
+ clearable?: boolean
477
+
478
+ /** A value for a `data-test` attribute on the root element **/
479
+ dataTest?: string
480
+
481
+ /** Renders a select with lower height **/
482
+ dense?: boolean
483
+
484
+ /** Disables all interactions with the select (except focussing) **/
485
+ disabled?: boolean
486
+
487
+ /** Text or component to display when there are no options **/
488
+ empty?: React.ReactNode
489
+
490
+ /** Applies 'error' appearance for validation feedback. Mutually exclusive with `warning` and `valid` props **/
491
+ error?: boolean
492
+
493
+ /** Help text that will be displayed below the input **/
494
+ filterHelpText?: string
495
+
496
+ /** Value will be used as aria-label attribute on the filter input **/
497
+ filterLabel?: string
498
+
499
+ /** Placeholder for the filter input **/
500
+ filterPlaceholder?: string
501
+
502
+ /** Value of the filter input **/
503
+ filterValue?: string
504
+
505
+ /** Whether the select should display a filter input **/
506
+ filterable?: boolean
507
+
508
+ /** Help text, displayed below the input **/
509
+ helpText?: string
510
+
511
+ /** Will show a loading indicator at the end of the options-list **/
512
+ loading?: boolean
513
+
514
+ /** Text that will be displayed next to the loading indicator **/
515
+ menuLoadingText?: string
516
+
517
+ /** Allows to modify the max height of the menu **/
518
+ menuMaxHeight?: string
519
+
520
+ /** String that will be displayed when the select is being filtered but the options array is empty **/
521
+ noMatchText?: string
522
+
523
+ /** Allows to override what's rendered inside the `button[role="option"]`.
524
+ * Can be overriden on an individual option basis **/
525
+ optionComponent?: React.ReactNode
526
+
527
+ /** For a11y: How aggressively the user should be updated about changes in options **/
528
+ optionUpdateStrategy?: 'off' | 'polite' | 'assertive'
529
+
530
+ /** String to show when there's no value and no valueLabel **/
531
+ placeholder?: string
532
+
533
+ /** String that will be displayed before the label of the selected option **/
534
+ prefix?: string
535
+
536
+ /** Whether a value is required or not **/
537
+ required?: boolean
538
+
539
+ /** Standard HTML tab-index attribute that will be put on the combobox's root element **/
540
+ tabIndex?: string | number
541
+
542
+ /** Applies 'valid' appearance for validation feedback. Mutually exclusive with `warning` and `valid` props **/
543
+ valid?: boolean
544
+
545
+ /** Text shown below input when `props.error` is true **/
546
+ validationText?: string
547
+
548
+ /** As of now, this component does not support being uncontrolled **/
549
+ value?: string
550
+
551
+ /**
552
+ * When the option is not in the options list (e.g. not loaded or list is
553
+ * filtered), but a selected value needs to be displayed, then this prop can
554
+ * be used to supply the text to be shown.
555
+ **/
556
+ valueLabel?: string
557
+
558
+ /** Applies 'warning' appearance for validation feedback. Mutually exclusive with `warning` and `valid` props **/
559
+ warning?: boolean
560
+
561
+ /** Will be called when the combobox is loses focus **/
562
+ onBlur?: (e: React.FocusEvent<HTMLElement>) => void
563
+
564
+ /** Will be called when the last option is scrolled into the visible area **/
565
+ onEndReached?: () => void
566
+
567
+ /** Will be called when the filter value changes **/
568
+ onFilterChange?: (value: string) => void
569
+
570
+ /** Will be called when the combobox is being focused **/
571
+ onFocus?: (e: React.FocusEvent<HTMLElement>) => void
572
+ }
573
+
574
+ export const SimpleSingleSelectField: React.FC<SimpleSingleSelectFieldProps>
453
575
  /**
454
576
  * ====================
455
577
  *