@dhis2-ui/select 10.17.0 → 10.19.0

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 (32) hide show
  1. package/build/cjs/simple-single-select/__stories__/WithMenuMaxWidth.js +34 -0
  2. package/build/cjs/simple-single-select/__stories__/WithMenuMinWidth.js +37 -0
  3. package/build/cjs/simple-single-select/menu/menu.js +17 -8
  4. package/build/cjs/simple-single-select/simple-single-select.js +19 -9
  5. package/build/cjs/simple-single-select/simple-single-select.prod.stories.js +14 -0
  6. package/build/cjs/simple-single-select/simple-single-select.test.js +62 -0
  7. package/build/cjs/simple-single-select-field/simple-single-select-field.js +4 -0
  8. package/build/cjs/simple-single-select-field/simple-single-select-field.prod.stories.js +53 -2
  9. package/build/cjs/simple-single-select-field/simple-single-select-field.test.js +4 -0
  10. package/build/cjs/single-select-option/single-select-option.js +4 -4
  11. package/build/es/simple-single-select/__stories__/WithMenuMaxWidth.js +26 -0
  12. package/build/es/simple-single-select/__stories__/WithMenuMinWidth.js +29 -0
  13. package/build/es/simple-single-select/menu/menu.js +17 -8
  14. package/build/es/simple-single-select/simple-single-select.js +19 -9
  15. package/build/es/simple-single-select/simple-single-select.prod.stories.js +2 -0
  16. package/build/es/simple-single-select/simple-single-select.test.js +62 -0
  17. package/build/es/simple-single-select-field/simple-single-select-field.js +4 -0
  18. package/build/es/simple-single-select-field/simple-single-select-field.prod.stories.js +49 -0
  19. package/build/es/simple-single-select-field/simple-single-select-field.test.js +4 -0
  20. package/build/es/single-select-option/single-select-option.js +4 -4
  21. package/package.json +15 -15
  22. package/src/simple-single-select/__stories__/WithMenuMaxWidth.js +24 -0
  23. package/src/simple-single-select/__stories__/WithMenuMinWidth.js +25 -0
  24. package/src/simple-single-select/menu/menu.js +26 -8
  25. package/src/simple-single-select/simple-single-select.js +19 -6
  26. package/src/simple-single-select/simple-single-select.prod.stories.js +2 -0
  27. package/src/simple-single-select/simple-single-select.test.js +68 -0
  28. package/src/simple-single-select-field/simple-single-select-field.js +6 -0
  29. package/src/simple-single-select-field/simple-single-select-field.prod.stories.js +49 -0
  30. package/src/simple-single-select-field/simple-single-select-field.test.js +4 -0
  31. package/src/single-select-option/single-select-option.js +5 -3
  32. package/types/index.d.ts +45 -1
package/types/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export interface MultiSelectEventPayload extends BaseEventPayload {
16
16
 
17
17
  type SelectEventHandler<
18
18
  T extends BaseEventPayload,
19
- Event extends React.SyntheticEvent
19
+ Event extends React.SyntheticEvent,
20
20
  > = (payload: T, event: Event) => void
21
21
 
22
22
  export type SelectOnBlurHandler<T extends BaseEventPayload> =
@@ -70,6 +70,14 @@ export interface MultiSelectProps {
70
70
  loading?: boolean
71
71
  loadingText?: string
72
72
  maxHeight?: string
73
+ /**
74
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
75
+ */
76
+ menuMaxWidth?: string
77
+ /**
78
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
79
+ */
80
+ menuMinWidth?: string
73
81
  /**
74
82
  * Required if `filterable` prop is `true`
75
83
  */
@@ -167,6 +175,14 @@ export interface MultiSelectFieldProps {
167
175
  * Constrains height of the MultiSelect
168
176
  */
169
177
  maxHeight?: string
178
+ /**
179
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
180
+ */
181
+ menuMaxWidth?: string
182
+ /**
183
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
184
+ */
185
+ menuMinWidth?: string
170
186
  /**
171
187
  * Text to display when there are no filter results
172
188
  */
@@ -285,6 +301,14 @@ export interface SingleSelectProps {
285
301
  loading?: boolean
286
302
  loadingText?: string
287
303
  maxHeight?: string
304
+ /**
305
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
306
+ */
307
+ menuMaxWidth?: string
308
+ /**
309
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
310
+ */
311
+ menuMinWidth?: string
288
312
  /**
289
313
  * Text to show when filter returns no results. Required if `filterable` prop is true
290
314
  */
@@ -403,6 +427,12 @@ export interface SimpleSingleSelectProps {
403
427
  /** Allows to modify the max height of the menu - Default is 288px **/
404
428
  menuMaxHeight?: string
405
429
 
430
+ /** See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width) **/
431
+ menuMaxWidth?: string
432
+
433
+ /** See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width) **/
434
+ menuMinWidth?: string
435
+
406
436
  /** String that will be displayed when the select is being filtered but the options array is empty **/
407
437
  noMatchText?: string
408
438
 
@@ -521,6 +551,12 @@ export interface SimpleSingleSelectFieldProps {
521
551
  /** Allows to modify the max height of the menu **/
522
552
  menuMaxHeight?: string
523
553
 
554
+ /** See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width) **/
555
+ menuMaxWidth?: string
556
+
557
+ /** See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width) **/
558
+ menuMinWidth?: string
559
+
524
560
  /** String that will be displayed when the select is being filtered but the options array is empty **/
525
561
  noMatchText?: string
526
562
 
@@ -655,6 +691,14 @@ export interface SingleSelectFieldProps {
655
691
  * Constrains height of the SingleSelect
656
692
  */
657
693
  maxHeight?: string
694
+ /**
695
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
696
+ */
697
+ menuMaxWidth?: string
698
+ /**
699
+ * See [dropdown menu width](https://developers.dhis2.org/docs/ui/components/select#dropdown-menu-width)
700
+ */
701
+ menuMinWidth?: string
658
702
  /**
659
703
  * Text to display when there are no filter results
660
704
  */