@dhis2-ui/select 10.16.2 → 10.16.3

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 (274) hide show
  1. package/package.json +17 -16
  2. package/src/index.js +9 -0
  3. package/src/locales/ar/translations.json +7 -0
  4. package/src/locales/ar_IQ/translations.json +7 -0
  5. package/src/locales/ckb/translations.json +7 -0
  6. package/src/locales/cs/translations.json +7 -0
  7. package/src/locales/da/translations.json +7 -0
  8. package/src/locales/en/translations.json +11 -0
  9. package/src/locales/en_US/translations.json +9 -0
  10. package/src/locales/es/translations.json +7 -0
  11. package/src/locales/es_419/translations.json +7 -0
  12. package/src/locales/fr/translations.json +7 -0
  13. package/src/locales/hi_IN/translations.json +7 -0
  14. package/src/locales/id/translations.json +7 -0
  15. package/src/locales/index.js +80 -0
  16. package/src/locales/km/translations.json +7 -0
  17. package/src/locales/lo/translations.json +7 -0
  18. package/src/locales/my/translations.json +7 -0
  19. package/src/locales/nb/translations.json +7 -0
  20. package/src/locales/nl/translations.json +7 -0
  21. package/src/locales/prs/translations.json +7 -0
  22. package/src/locales/ps/translations.json +7 -0
  23. package/src/locales/pt/translations.json +7 -0
  24. package/src/locales/pt_BR/translations.json +7 -0
  25. package/src/locales/ru/translations.json +7 -0
  26. package/src/locales/sv/translations.json +7 -0
  27. package/src/locales/tet/translations.json +7 -0
  28. package/src/locales/tg/translations.json +7 -0
  29. package/src/locales/uk/translations.json +7 -0
  30. package/src/locales/ur/translations.json +7 -0
  31. package/src/locales/uz_Latn/translations.json +7 -0
  32. package/src/locales/uz_UZ_Cyrl/translations.json +7 -0
  33. package/src/locales/uz_UZ_Latn/translations.json +7 -0
  34. package/src/locales/vi/translations.json +7 -0
  35. package/src/locales/zh/translations.json +9 -0
  36. package/src/locales/zh_CN/translations.json +7 -0
  37. package/src/multi-select/__tests__/multi-select.test.js +23 -0
  38. package/src/multi-select/__tests__/selection-list.test.js +102 -0
  39. package/src/multi-select/features/accepts_blur_cb/index.js +14 -0
  40. package/src/multi-select/features/accepts_blur_cb.feature +8 -0
  41. package/src/multi-select/features/accepts_focus_cb/index.js +14 -0
  42. package/src/multi-select/features/accepts_focus_cb.feature +6 -0
  43. package/src/multi-select/features/accepts_initial_focus/index.js +5 -0
  44. package/src/multi-select/features/accepts_initial_focus.feature +5 -0
  45. package/src/multi-select/features/accepts_loading/index.js +22 -0
  46. package/src/multi-select/features/accepts_loading.feature +14 -0
  47. package/src/multi-select/features/accepts_max_height/index.js +31 -0
  48. package/src/multi-select/features/accepts_max_height.feature +11 -0
  49. package/src/multi-select/features/accepts_placeholder/index.js +25 -0
  50. package/src/multi-select/features/accepts_placeholder.feature +10 -0
  51. package/src/multi-select/features/accepts_prefix/index.js +19 -0
  52. package/src/multi-select/features/accepts_prefix.feature +10 -0
  53. package/src/multi-select/features/allows_invalid_options/index.js +27 -0
  54. package/src/multi-select/features/allows_invalid_options.feature +12 -0
  55. package/src/multi-select/features/allows_selecting/index.js +81 -0
  56. package/src/multi-select/features/allows_selecting.feature +44 -0
  57. package/src/multi-select/features/can_be_cleared/index.js +22 -0
  58. package/src/multi-select/features/can_be_cleared.feature +6 -0
  59. package/src/multi-select/features/can_be_disabled/index.js +36 -0
  60. package/src/multi-select/features/can_be_disabled.feature +32 -0
  61. package/src/multi-select/features/can_be_empty/index.js +28 -0
  62. package/src/multi-select/features/can_be_empty.feature +16 -0
  63. package/src/multi-select/features/can_be_filtered/index.js +23 -0
  64. package/src/multi-select/features/can_be_filtered.feature +14 -0
  65. package/src/multi-select/features/can_be_opened_and_closed/index.js +32 -0
  66. package/src/multi-select/features/can_be_opened_and_closed.feature +41 -0
  67. package/src/multi-select/features/common/index.js +49 -0
  68. package/src/multi-select/features/duplicate_option_values/index.js +21 -0
  69. package/src/multi-select/features/duplicate_option_values.feature +7 -0
  70. package/src/multi-select/features/menu_width_matches_input/index.js +53 -0
  71. package/src/multi-select/features/menu_width_matches_input.feature +11 -0
  72. package/src/multi-select/features/position/index.js +160 -0
  73. package/src/multi-select/features/position.feature +46 -0
  74. package/src/multi-select/features/shows_selections/index.js +18 -0
  75. package/src/multi-select/features/shows_selections.feature +9 -0
  76. package/src/multi-select/filterable-menu.js +43 -0
  77. package/src/multi-select/index.js +1 -0
  78. package/src/multi-select/input.js +129 -0
  79. package/src/multi-select/menu.js +91 -0
  80. package/src/multi-select/multi-select.e2e.stories.js +407 -0
  81. package/src/multi-select/multi-select.js +148 -0
  82. package/src/multi-select/multi-select.prod.stories.js +408 -0
  83. package/src/multi-select/selection-list.js +79 -0
  84. package/src/multi-select-field/__tests__/multi-select-field.test.js +29 -0
  85. package/src/multi-select-field/features/accepts_help_text/index.js +9 -0
  86. package/src/multi-select-field/features/accepts_help_text.feature +5 -0
  87. package/src/multi-select-field/features/accepts_label/index.js +9 -0
  88. package/src/multi-select-field/features/accepts_label.feature +5 -0
  89. package/src/multi-select-field/features/accepts_validation_text/index.js +9 -0
  90. package/src/multi-select-field/features/accepts_validation_text.feature +5 -0
  91. package/src/multi-select-field/features/can_be_required/index.js +11 -0
  92. package/src/multi-select-field/features/can_be_required.feature +5 -0
  93. package/src/multi-select-field/features/has_default_clear_text/index.js +16 -0
  94. package/src/multi-select-field/features/has_default_clear_text.feature +6 -0
  95. package/src/multi-select-field/features/has_default_empty_text/index.js +13 -0
  96. package/src/multi-select-field/features/has_default_empty_text.feature +6 -0
  97. package/src/multi-select-field/features/has_default_filter_nomatch_text/index.js +17 -0
  98. package/src/multi-select-field/features/has_default_filter_nomatch_text.feature +7 -0
  99. package/src/multi-select-field/features/has_default_filter_placeholder/index.js +15 -0
  100. package/src/multi-select-field/features/has_default_filter_placeholder.feature +6 -0
  101. package/src/multi-select-field/features/has_default_loading_text/index.js +13 -0
  102. package/src/multi-select-field/features/has_default_loading_text.feature +6 -0
  103. package/src/multi-select-field/index.js +1 -0
  104. package/src/multi-select-field/multi-select-field.e2e.stories.js +45 -0
  105. package/src/multi-select-field/multi-select-field.js +178 -0
  106. package/src/multi-select-field/multi-select-field.prod.stories.js +137 -0
  107. package/src/multi-select-option/index.js +1 -0
  108. package/src/multi-select-option/multi-select-option.js +70 -0
  109. package/src/select/__tests__/select.test.js +31 -0
  110. package/src/select/debounce/debounce.js +30 -0
  111. package/src/select/debounce/debounce.spec.js +35 -0
  112. package/src/select/empty.js +28 -0
  113. package/src/select/filter-input.js +42 -0
  114. package/src/select/filterable-menu.js +106 -0
  115. package/src/select/index.js +14 -0
  116. package/src/select/input-clear-button.js +66 -0
  117. package/src/select/input-placeholder.js +30 -0
  118. package/src/select/input-prefix.js +32 -0
  119. package/src/select/input-wrapper.js +114 -0
  120. package/src/select/loading.js +33 -0
  121. package/src/select/menu-wrapper.js +52 -0
  122. package/src/select/no-match.js +28 -0
  123. package/src/select/option-helpers.js +34 -0
  124. package/src/select/select.js +256 -0
  125. package/src/simple-single-select/__stories__/DefaultPosition.js +37 -0
  126. package/src/simple-single-select/__stories__/Dense.js +17 -0
  127. package/src/simple-single-select/__stories__/Empty.js +15 -0
  128. package/src/simple-single-select/__stories__/EmptyWithEmptyNode.js +27 -0
  129. package/src/simple-single-select/__stories__/EmptyWithEmptyText.js +16 -0
  130. package/src/simple-single-select/__stories__/FlippedPosition.js +36 -0
  131. package/src/simple-single-select/__stories__/InfiniteLoading.js +65 -0
  132. package/src/simple-single-select/__stories__/Loading.js +15 -0
  133. package/src/simple-single-select/__stories__/ShiftedIntoView.js +35 -0
  134. package/src/simple-single-select/__stories__/WithClearButton.js +26 -0
  135. package/src/simple-single-select/__stories__/WithCustomLowMaxHeight.js +17 -0
  136. package/src/simple-single-select/__stories__/WithCustomOptions.js +78 -0
  137. package/src/simple-single-select/__stories__/WithDisabledOption.js +25 -0
  138. package/src/simple-single-select/__stories__/WithFilterField.js +30 -0
  139. package/src/simple-single-select/__stories__/WithInitialFocus.js +29 -0
  140. package/src/simple-single-select/__stories__/WithManyOptions.js +19 -0
  141. package/src/simple-single-select/__stories__/WithMultipleSelectsAndScrollableParent.js +65 -0
  142. package/src/simple-single-select/__stories__/WithNoMatchText.js +25 -0
  143. package/src/simple-single-select/__stories__/WithOnBlur.js +22 -0
  144. package/src/simple-single-select/__stories__/WithOnFocus.js +22 -0
  145. package/src/simple-single-select/__stories__/WithOptionsAndDisabled.js +17 -0
  146. package/src/simple-single-select/__stories__/WithOptionsAndLoading.js +23 -0
  147. package/src/simple-single-select/__stories__/WithOptionsAndLoadingText.js +24 -0
  148. package/src/simple-single-select/__stories__/WithPlaceholder.js +18 -0
  149. package/src/simple-single-select/__stories__/WithPlaceholderAndSelection.js +20 -0
  150. package/src/simple-single-select/__stories__/WithPrefix.js +17 -0
  151. package/src/simple-single-select/__stories__/WithPrefixAndSelection.js +20 -0
  152. package/src/simple-single-select/__stories__/WithRTL.js +29 -0
  153. package/src/simple-single-select/__stories__/WithScrollingParent.js +51 -0
  154. package/src/simple-single-select/__stories__/WithSelection.js +19 -0
  155. package/src/simple-single-select/__stories__/WithSelectionAndDisabled.js +20 -0
  156. package/src/simple-single-select/__stories__/WithServerSideFilteringDemo.js +245 -0
  157. package/src/simple-single-select/__stories__/WithSimpleFilteringDemo.js +50 -0
  158. package/src/simple-single-select/__stories__/WithoutOptionsAndLoading.js +16 -0
  159. package/src/simple-single-select/__stories__/WithoutSelection.js +17 -0
  160. package/src/simple-single-select/__stories__/options.js +96 -0
  161. package/src/simple-single-select/__stories__/simple-single-select-server-side-filtering/CustomDataProvider.js +70 -0
  162. package/src/simple-single-select/__stories__/simple-single-select-server-side-filtering/dataElements.js +4271 -0
  163. package/src/simple-single-select/__stories__/simple-single-select-server-side-filtering/index.js +1 -0
  164. package/src/simple-single-select/features/keyboard-interactions.test.e2e.js +581 -0
  165. package/src/simple-single-select/features/menu-positioning.test.e2e.js +187 -0
  166. package/src/simple-single-select/index.js +2 -0
  167. package/src/simple-single-select/is-option-hidden.js +21 -0
  168. package/src/simple-single-select/menu/empty.js +27 -0
  169. package/src/simple-single-select/menu/filter.js +61 -0
  170. package/src/simple-single-select/menu/index.js +1 -0
  171. package/src/simple-single-select/menu/loading.js +38 -0
  172. package/src/simple-single-select/menu/menu.js +171 -0
  173. package/src/simple-single-select/menu/no-match.js +28 -0
  174. package/src/simple-single-select/menu/option.js +161 -0
  175. package/src/simple-single-select/menu/options-list.js +107 -0
  176. package/src/simple-single-select/selected-value/clear-button.js +71 -0
  177. package/src/simple-single-select/selected-value/container.js +146 -0
  178. package/src/simple-single-select/selected-value/index.js +1 -0
  179. package/src/simple-single-select/selected-value/placeholder.js +24 -0
  180. package/src/simple-single-select/selected-value/prefix.js +26 -0
  181. package/src/simple-single-select/selected-value/selected-value.js +174 -0
  182. package/src/simple-single-select/shared-prop-types.js +8 -0
  183. package/src/simple-single-select/simple-single-select.e2e.stories.js +216 -0
  184. package/src/simple-single-select/simple-single-select.js +389 -0
  185. package/src/simple-single-select/simple-single-select.prod.stories.js +41 -0
  186. package/src/simple-single-select/simple-single-select.test.js +1136 -0
  187. package/src/simple-single-select/use-handle-key-press/index.js +2 -0
  188. package/src/simple-single-select/use-handle-key-press/use-focus-option.js +24 -0
  189. package/src/simple-single-select/use-handle-key-press/use-handle-key-press-on-combobox.js +259 -0
  190. package/src/simple-single-select/use-handle-key-press/use-handle-key-press-on-filter-input.js +147 -0
  191. package/src/simple-single-select/use-handle-key-press/use-handle-typing.js +79 -0
  192. package/src/simple-single-select/use-handle-key-press/use-highlight-first-option-on-previous-page.js +62 -0
  193. package/src/simple-single-select/use-handle-key-press/use-highlight-first-visible-option.js +38 -0
  194. package/src/simple-single-select/use-handle-key-press/use-highlight-last-option-on-next-page.js +60 -0
  195. package/src/simple-single-select/use-handle-key-press/use-highlight-last-visible-option.js +52 -0
  196. package/src/simple-single-select/use-handle-key-press/use-page-down.js +50 -0
  197. package/src/simple-single-select/use-handle-key-press/use-page-up.js +50 -0
  198. package/src/simple-single-select/use-handle-key-press/utils.js +23 -0
  199. package/src/simple-single-select-field/index.js +1 -0
  200. package/src/simple-single-select-field/simple-single-select-field.js +198 -0
  201. package/src/simple-single-select-field/simple-single-select-field.prod.stories.js +188 -0
  202. package/src/simple-single-select-field/simple-single-select-field.test.js +144 -0
  203. package/src/single-select/__tests__/selection.test.js +102 -0
  204. package/src/single-select/__tests__/single-select.test.js +23 -0
  205. package/src/single-select/features/accepts_blur_cb/index.js +14 -0
  206. package/src/single-select/features/accepts_blur_cb.feature +8 -0
  207. package/src/single-select/features/accepts_focus_cb/index.js +14 -0
  208. package/src/single-select/features/accepts_focus_cb.feature +6 -0
  209. package/src/single-select/features/accepts_initial_focus/index.js +5 -0
  210. package/src/single-select/features/accepts_initial_focus.feature +5 -0
  211. package/src/single-select/features/accepts_loading/index.js +22 -0
  212. package/src/single-select/features/accepts_loading.feature +14 -0
  213. package/src/single-select/features/accepts_max_height/index.js +31 -0
  214. package/src/single-select/features/accepts_max_height.feature +11 -0
  215. package/src/single-select/features/accepts_placeholder/index.js +25 -0
  216. package/src/single-select/features/accepts_placeholder.feature +10 -0
  217. package/src/single-select/features/accepts_prefix/index.js +19 -0
  218. package/src/single-select/features/accepts_prefix.feature +10 -0
  219. package/src/single-select/features/allows_invalid_options/index.js +28 -0
  220. package/src/single-select/features/allows_invalid_options.feature +12 -0
  221. package/src/single-select/features/allows_selecting/index.js +38 -0
  222. package/src/single-select/features/allows_selecting.feature +21 -0
  223. package/src/single-select/features/can_be_cleared/index.js +22 -0
  224. package/src/single-select/features/can_be_cleared.feature +6 -0
  225. package/src/single-select/features/can_be_disabled/index.js +39 -0
  226. package/src/single-select/features/can_be_disabled.feature +32 -0
  227. package/src/single-select/features/can_be_empty/index.js +28 -0
  228. package/src/single-select/features/can_be_empty.feature +16 -0
  229. package/src/single-select/features/can_be_filtered/index.js +23 -0
  230. package/src/single-select/features/can_be_filtered.feature +14 -0
  231. package/src/single-select/features/can_be_opened_and_closed/index.js +32 -0
  232. package/src/single-select/features/can_be_opened_and_closed.feature +41 -0
  233. package/src/single-select/features/common/index.js +44 -0
  234. package/src/single-select/features/duplicate_option_values/index.js +26 -0
  235. package/src/single-select/features/duplicate_option_values.feature +7 -0
  236. package/src/single-select/features/menu_width_matches_input/index.js +53 -0
  237. package/src/single-select/features/menu_width_matches_input.feature +11 -0
  238. package/src/single-select/features/position/index.js +111 -0
  239. package/src/single-select/features/position.feature +26 -0
  240. package/src/single-select/features/shows_selections/index.js +9 -0
  241. package/src/single-select/features/shows_selections.feature +5 -0
  242. package/src/single-select/filterable-menu.js +41 -0
  243. package/src/single-select/index.js +1 -0
  244. package/src/single-select/input.js +101 -0
  245. package/src/single-select/menu.js +75 -0
  246. package/src/single-select/selection.js +60 -0
  247. package/src/single-select/single-select.e2e.stories.js +376 -0
  248. package/src/single-select/single-select.js +146 -0
  249. package/src/single-select/single-select.prod.stories.js +358 -0
  250. package/src/single-select-field/__tests__/single-select-field.test.js +29 -0
  251. package/src/single-select-field/features/accepts_help_text/index.js +9 -0
  252. package/src/single-select-field/features/accepts_help_text.feature +5 -0
  253. package/src/single-select-field/features/accepts_label/index.js +9 -0
  254. package/src/single-select-field/features/accepts_label.feature +5 -0
  255. package/src/single-select-field/features/accepts_validation_text/index.js +9 -0
  256. package/src/single-select-field/features/accepts_validation_text.feature +5 -0
  257. package/src/single-select-field/features/can_be_required/index.js +11 -0
  258. package/src/single-select-field/features/can_be_required.feature +5 -0
  259. package/src/single-select-field/features/has_default_clear_text/index.js +16 -0
  260. package/src/single-select-field/features/has_default_clear_text.feature +6 -0
  261. package/src/single-select-field/features/has_default_empty_text/index.js +13 -0
  262. package/src/single-select-field/features/has_default_empty_text.feature +6 -0
  263. package/src/single-select-field/features/has_default_filter_nomatch_text/index.js +17 -0
  264. package/src/single-select-field/features/has_default_filter_nomatch_text.feature +7 -0
  265. package/src/single-select-field/features/has_default_filter_placeholder/index.js +15 -0
  266. package/src/single-select-field/features/has_default_filter_placeholder.feature +6 -0
  267. package/src/single-select-field/features/has_default_loading_text/index.js +13 -0
  268. package/src/single-select-field/features/has_default_loading_text.feature +6 -0
  269. package/src/single-select-field/index.js +1 -0
  270. package/src/single-select-field/single-select-field.e2e.stories.js +45 -0
  271. package/src/single-select-field/single-select-field.js +178 -0
  272. package/src/single-select-field/single-select-field.prod.stories.js +146 -0
  273. package/src/single-select-option/index.js +1 -0
  274. package/src/single-select-option/single-select-option.js +84 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/select",
3
- "version": "10.16.2",
3
+ "version": "10.16.3",
4
4
  "description": "UI Select",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,27 +33,28 @@
33
33
  "styled-jsx": "^4"
34
34
  },
35
35
  "dependencies": {
36
- "@dhis2-ui/box": "10.16.2",
37
- "@dhis2-ui/button": "10.16.2",
38
- "@dhis2-ui/card": "10.16.2",
39
- "@dhis2-ui/checkbox": "10.16.2",
40
- "@dhis2-ui/chip": "10.16.2",
41
- "@dhis2-ui/field": "10.16.2",
42
- "@dhis2-ui/input": "10.16.2",
43
- "@dhis2-ui/layer": "10.16.2",
44
- "@dhis2-ui/loader": "10.16.2",
45
- "@dhis2-ui/popper": "10.16.2",
46
- "@dhis2-ui/status-icon": "10.16.2",
47
- "@dhis2-ui/tooltip": "10.16.2",
36
+ "@dhis2-ui/box": "10.16.3",
37
+ "@dhis2-ui/button": "10.16.3",
38
+ "@dhis2-ui/card": "10.16.3",
39
+ "@dhis2-ui/checkbox": "10.16.3",
40
+ "@dhis2-ui/chip": "10.16.3",
41
+ "@dhis2-ui/field": "10.16.3",
42
+ "@dhis2-ui/input": "10.16.3",
43
+ "@dhis2-ui/layer": "10.16.3",
44
+ "@dhis2-ui/loader": "10.16.3",
45
+ "@dhis2-ui/popper": "10.16.3",
46
+ "@dhis2-ui/status-icon": "10.16.3",
47
+ "@dhis2-ui/tooltip": "10.16.3",
48
48
  "@dhis2/prop-types": "^3.1.2",
49
- "@dhis2/ui-constants": "10.16.2",
50
- "@dhis2/ui-icons": "10.16.2",
49
+ "@dhis2/ui-constants": "10.16.3",
50
+ "@dhis2/ui-icons": "10.16.3",
51
51
  "classnames": "^2.3.1",
52
52
  "prop-types": "^15.7.2"
53
53
  },
54
54
  "files": [
55
55
  "build",
56
- "types"
56
+ "types",
57
+ "src"
57
58
  ],
58
59
  "devDependencies": {
59
60
  "@dhis2/d2-i18n": "^1.1.0",
package/src/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export { MultiSelect } from './multi-select/index.js'
2
+ export { MultiSelectField } from './multi-select-field/index.js'
3
+ export { MultiSelectOption } from './multi-select-option/index.js'
4
+
5
+ export { SingleSelect } from './single-select/index.js'
6
+ export { SimpleSingleSelect } from './simple-single-select/index.js'
7
+ export { SimpleSingleSelectField } from './simple-single-select-field/index.js'
8
+ export { SingleSelectField } from './single-select-field/index.js'
9
+ export { SingleSelectOption } from './single-select-option/index.js'
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "مسح",
3
+ "No data found": "لم يتم إيجاد بيانات",
4
+ "Type to filter options": "اكتب لتصفية الخيارات",
5
+ "Loading options": "تحميل الخيارات",
6
+ "No options found": "لم يتم العثور على خيارات"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "مسح",
3
+ "No data found": "",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "پاککردنەوە",
3
+ "No data found": "",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Vyčistit",
3
+ "No data found": "Nenalezena žádná data",
4
+ "Type to filter options": "Zadáním filtrujete možnosti",
5
+ "Loading options": "Možnosti načítání",
6
+ "No options found": "Nenalezeny žádné možnosti"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Clear",
3
+ "No data found": "",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "{{count}} selected": "{{count}} selected",
3
+ "{{count}} selected_plural": "{{count}} selected",
4
+ "Clear": "Clear",
5
+ "No data found": "No data found",
6
+ "Type to filter options": "Type to filter options",
7
+ "Loading options": "Loading options",
8
+ "No options found": "No options found",
9
+ "Search options": "Search options",
10
+ "{{clearText}}": "{{clearText}}"
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "Clear": "साफ़ करें",
3
+ "No data found": "",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": "",
7
+ "Search options": "",
8
+ "{{clearText}}": ""
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Limpiar",
3
+ "No data found": "Datos no encontrados",
4
+ "Type to filter options": "Escriba para filtrar opciones",
5
+ "Loading options": "Cargando las opciones",
6
+ "No options found": "No se ha encontrado ninguna opción"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Limpiar",
3
+ "No data found": "No se han encontrado datos",
4
+ "Type to filter options": "Escriba para filtrar opciones",
5
+ "Loading options": "Opciones de carga",
6
+ "No options found": "No se han encontrado opciones"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Effacer",
3
+ "No data found": "Aucune valeur trouvée",
4
+ "Type to filter options": "Tapez pour filtrer les options",
5
+ "Loading options": "Chargement des options",
6
+ "No options found": "Pas d'options trouvées"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "साफ़ करें",
3
+ "No data found": "",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Hapus",
3
+ "No data found": "Tidak ada data yang ditemukan",
4
+ "Type to filter options": "Tipe opsi filter",
5
+ "Loading options": "Opsi mengunggah",
6
+ "No options found": "Opsi tidak tersedia"
7
+ }
@@ -0,0 +1,80 @@
1
+ //------------------------------------------------------------------------------
2
+ // <auto-generated>
3
+ // This code was generated by d2-i18n-generate.
4
+ //
5
+ // Changes to this file may cause incorrect behavior and will be lost if
6
+ // the code is regenerated.
7
+ // </auto-generated>
8
+ //------------------------------------------------------------------------------
9
+ import i18n from '@dhis2/d2-i18n'
10
+
11
+ import arTranslations from './ar/translations.json'
12
+ import ar_IQTranslations from './ar_IQ/translations.json'
13
+ import ckbTranslations from './ckb/translations.json'
14
+ import csTranslations from './cs/translations.json'
15
+ import daTranslations from './da/translations.json'
16
+ import enTranslations from './en/translations.json'
17
+ import en_USTranslations from './en_US/translations.json'
18
+ import esTranslations from './es/translations.json'
19
+ import es_419Translations from './es_419/translations.json'
20
+ import frTranslations from './fr/translations.json'
21
+ import hi_INTranslations from './hi_IN/translations.json'
22
+ import idTranslations from './id/translations.json'
23
+ import kmTranslations from './km/translations.json'
24
+ import loTranslations from './lo/translations.json'
25
+ import myTranslations from './my/translations.json'
26
+ import nbTranslations from './nb/translations.json'
27
+ import nlTranslations from './nl/translations.json'
28
+ import prsTranslations from './prs/translations.json'
29
+ import psTranslations from './ps/translations.json'
30
+ import ptTranslations from './pt/translations.json'
31
+ import pt_BRTranslations from './pt_BR/translations.json'
32
+ import ruTranslations from './ru/translations.json'
33
+ import svTranslations from './sv/translations.json'
34
+ import tetTranslations from './tet/translations.json'
35
+ import tgTranslations from './tg/translations.json'
36
+ import ukTranslations from './uk/translations.json'
37
+ import urTranslations from './ur/translations.json'
38
+ import uz_LatnTranslations from './uz_Latn/translations.json'
39
+ import uz_UZ_CyrlTranslations from './uz_UZ_Cyrl/translations.json'
40
+ import uz_UZ_LatnTranslations from './uz_UZ_Latn/translations.json'
41
+ import viTranslations from './vi/translations.json'
42
+ import zhTranslations from './zh/translations.json'
43
+ import zh_CNTranslations from './zh_CN/translations.json'
44
+
45
+ const namespace = 'default'
46
+ i18n.addResources('ar', namespace, arTranslations)
47
+ i18n.addResources('ar_IQ', namespace, ar_IQTranslations)
48
+ i18n.addResources('ckb', namespace, ckbTranslations)
49
+ i18n.addResources('cs', namespace, csTranslations)
50
+ i18n.addResources('da', namespace, daTranslations)
51
+ i18n.addResources('en', namespace, enTranslations)
52
+ i18n.addResources('en_US', namespace, en_USTranslations)
53
+ i18n.addResources('es', namespace, esTranslations)
54
+ i18n.addResources('es_419', namespace, es_419Translations)
55
+ i18n.addResources('fr', namespace, frTranslations)
56
+ i18n.addResources('hi_IN', namespace, hi_INTranslations)
57
+ i18n.addResources('id', namespace, idTranslations)
58
+ i18n.addResources('km', namespace, kmTranslations)
59
+ i18n.addResources('lo', namespace, loTranslations)
60
+ i18n.addResources('my', namespace, myTranslations)
61
+ i18n.addResources('nb', namespace, nbTranslations)
62
+ i18n.addResources('nl', namespace, nlTranslations)
63
+ i18n.addResources('prs', namespace, prsTranslations)
64
+ i18n.addResources('ps', namespace, psTranslations)
65
+ i18n.addResources('pt', namespace, ptTranslations)
66
+ i18n.addResources('pt_BR', namespace, pt_BRTranslations)
67
+ i18n.addResources('ru', namespace, ruTranslations)
68
+ i18n.addResources('sv', namespace, svTranslations)
69
+ i18n.addResources('tet', namespace, tetTranslations)
70
+ i18n.addResources('tg', namespace, tgTranslations)
71
+ i18n.addResources('uk', namespace, ukTranslations)
72
+ i18n.addResources('ur', namespace, urTranslations)
73
+ i18n.addResources('uz_Latn', namespace, uz_LatnTranslations)
74
+ i18n.addResources('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations)
75
+ i18n.addResources('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations)
76
+ i18n.addResources('vi', namespace, viTranslations)
77
+ i18n.addResources('zh', namespace, zhTranslations)
78
+ i18n.addResources('zh_CN', namespace, zh_CNTranslations)
79
+
80
+ export default i18n
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "សម្អាត",
3
+ "No data found": "មិនមានទិន្នន័យបង្ហាញ",
4
+ "Type to filter options": "វាយបញ្ចូលមុខងារដើម្បីច្រោះ",
5
+ "Loading options": "កំពុងទាញយកមុខងារ",
6
+ "No options found": "មិនមានមុខងារបង្ហាញ"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "ລຶບ",
3
+ "No data found": "ບໍ່ພົບຂໍ້ມູນ",
4
+ "Type to filter options": "ປະເພດຕົວເລືອກການກອງ",
5
+ "Loading options": "ໂຫຼດຕົວເລືອກ",
6
+ "No options found": "ບໍ່ພົບຕົວເລືອກ"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "ရှင်းလင်းသည်",
3
+ "No data found": "data မတွေ့ပါ။",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Fjern",
3
+ "No data found": "Ingen data funnet",
4
+ "Type to filter options": "Skriv for å filtrere alternativer",
5
+ "Loading options": "Laster alternativer",
6
+ "No options found": "Ingen alternativer funnet"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Duidelijk",
3
+ "No data found": "Geen gegevens gevonden",
4
+ "Type to filter options": "Typ om opties te filteren",
5
+ "Loading options": "Laad opties",
6
+ "No options found": "Geen opties gevonden"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "پاک کردن",
3
+ "No data found": "هیچ معلوماتی یافت نشد",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "پاک یې کړئ",
3
+ "No data found": "هېڅ ډاټا یا مالومات ونه موندل شول",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Limpar",
3
+ "No data found": "Não foram encontrados dados",
4
+ "Type to filter options": "Tipo de opções de filtros",
5
+ "Loading options": "Carregando opções",
6
+ "No options found": "Não foram encontradas opções"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Limpar",
3
+ "No data found": "Dado não encontrado",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Очистить",
3
+ "No data found": "Данные не найдены",
4
+ "Type to filter options": "Начать печатать для фильтрации опций",
5
+ "Loading options": "Загрузка опций",
6
+ "No options found": "Опции не найдены"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Klar",
3
+ "No data found": "",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Hamós",
3
+ "No data found": "",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Пок кардан",
3
+ "No data found": "Ягон иттилоот ёфт нашуд",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Очистити",
3
+ "No data found": "Даних не знайдено",
4
+ "Type to filter options": "Введіть параметри фільтра",
5
+ "Loading options": "Параметри завантаження",
6
+ "No options found": "Варіантів не знайдено"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "کلیئر",
3
+ "No data found": "کوئی ڈیٹا نہیں ملا",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Аниқ",
3
+ "No data found": "Maʼlumotlar topilmadi",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Тозалаш",
3
+ "No data found": "Маълумотлар топилмади",
4
+ "Type to filter options": "",
5
+ "Loading options": "Вариантлар юкланмоқда",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Аниқ",
3
+ "No data found": "Maʼlumotlar topilmadi",
4
+ "Type to filter options": "",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "Xóa",
3
+ "No data found": "Không tìm thấy dữ liệu",
4
+ "Type to filter options": "Nhập để lọc tùy chọn",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "Clear": "清除",
3
+ "No data found": "没有发现数据",
4
+ "Type to filter options": "键入过滤选项",
5
+ "Loading options": "加载选项",
6
+ "No options found": "没有找到选项",
7
+ "Search options": "搜索选项",
8
+ "{{clearText}}": "{{clearText}}"
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Clear": "清除",
3
+ "No data found": "没有数据被找到",
4
+ "Type to filter options": "键入过滤选项",
5
+ "Loading options": "",
6
+ "No options found": ""
7
+ }
@@ -0,0 +1,23 @@
1
+ import { render, fireEvent, screen } from '@testing-library/react'
2
+ import React from 'react'
3
+ import { MultiSelect } from '../multi-select.js'
4
+
5
+ describe('<MultiSelect />', () => {
6
+ it('should call the onKeyDown callback when provided', () => {
7
+ const onKeyDown = jest.fn()
8
+
9
+ render(<MultiSelect placeholder="placeholder" onKeyDown={onKeyDown} />)
10
+
11
+ fireEvent.keyDown(
12
+ screen.getByTestId('dhis2-uicore-multiselect-placeholder'),
13
+ { key: 'Enter', code: 'Enter', charCode: 13 }
14
+ )
15
+
16
+ expect(onKeyDown).toHaveBeenCalledWith(
17
+ { selected: [] },
18
+ expect.objectContaining({})
19
+ )
20
+
21
+ expect(onKeyDown).toHaveBeenCalledTimes(1)
22
+ })
23
+ })
@@ -0,0 +1,102 @@
1
+ import { render } from '@testing-library/react'
2
+ import React from 'react'
3
+ import { MultiSelectOption } from '../../multi-select-option/index.js'
4
+ import { SelectionList } from '../selection-list.js'
5
+ import '@testing-library/jest-dom'
6
+
7
+ describe('<SelectionList />', () => {
8
+ const env = process.env
9
+
10
+ beforeEach(() => {
11
+ // Ensure process.env is also reset for cached modules
12
+ jest.resetModules()
13
+ process.env = { ...env }
14
+
15
+ // Allow spying on console.error and silence rendering errors
16
+ jest.spyOn(console, 'error').mockImplementation(() => {})
17
+ })
18
+
19
+ afterEach(() => {
20
+ // Restore process.env to original state
21
+ process.env = env
22
+
23
+ // Restore all mocks back to original values
24
+ jest.restoreAllMocks()
25
+ })
26
+
27
+ describe('production', () => {
28
+ it('should not throw an error for a selection that is not in the options', () => {
29
+ process.env.NODE_ENV = 'production'
30
+ const options = <MultiSelectOption key="1" label="one" value="1" />
31
+ const selected = ['value']
32
+
33
+ expect(() => {
34
+ render(
35
+ <SelectionList
36
+ selected={selected}
37
+ options={options}
38
+ disabled={false}
39
+ onChange={() => {}}
40
+ />
41
+ )
42
+ }).not.toThrow()
43
+ })
44
+
45
+ it('should show the selection for a selection that is not in the options', () => {
46
+ process.env.NODE_ENV = 'production'
47
+ const options = <MultiSelectOption key="1" label="one" value="1" />
48
+ const selected = ['value']
49
+
50
+ const { getByText } = render(
51
+ <SelectionList
52
+ selected={selected}
53
+ options={options}
54
+ disabled={false}
55
+ onChange={() => {}}
56
+ />
57
+ )
58
+
59
+ expect(getByText(selected)).toBeInTheDocument()
60
+ })
61
+
62
+ it('log an error for a selection that is not in the options', () => {
63
+ process.env.NODE_ENV = 'production'
64
+ const options = <MultiSelectOption key="1" label="one" value="1" />
65
+ const selected = ['value']
66
+
67
+ render(
68
+ <SelectionList
69
+ selected={selected}
70
+ options={options}
71
+ disabled={false}
72
+ onChange={() => {}}
73
+ />
74
+ )
75
+
76
+ expect(console.error).toHaveBeenCalledWith(
77
+ 'There is no option with the value: "value". Make sure that all the values passed to the selected prop match the value of an existing option.'
78
+ )
79
+ })
80
+ })
81
+
82
+ describe('not production', () => {
83
+ it('should throw an error for a selection that is not in the options', () => {
84
+ process.env.NODE_ENV = 'development'
85
+ const options = <MultiSelectOption key="1" label="one" value="1" />
86
+ const selected = ['value']
87
+
88
+ expect(() => {
89
+ render(
90
+ <SelectionList
91
+ selected={selected}
92
+ options={options}
93
+ disabled={false}
94
+ onChange={() => {}}
95
+ />
96
+ )
97
+ }).toThrow(
98
+ 'There is no option with the value: "value". Make sure that all the values passed to the selected prop match the value of an existing option.'
99
+ )
100
+ })
101
+ })
102
+ })
@@ -0,0 +1,14 @@
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'
2
+
3
+ Given('a MultiSelect with onBlur handler is rendered', () => {
4
+ cy.visitStory('MultiSelect', 'With on blur')
5
+ })
6
+
7
+ Then('the onBlur handler is called', () => {
8
+ cy.window().should((win) => {
9
+ expect(win.onBlur).to.be.calledOnce
10
+ expect(win.onBlur).to.be.calledWith({
11
+ selected: [],
12
+ })
13
+ })
14
+ })
@@ -0,0 +1,8 @@
1
+ Feature: Calls onBlur cb when blurred
2
+
3
+ Scenario: Blurring a MultiSelect through clicking away
4
+ Given a MultiSelect with onBlur handler is rendered
5
+ And the MultiSelect input is clicked
6
+ And the MultiSelect has focus
7
+ When the user clicks the backdrop layer
8
+ Then the onBlur handler is called
@@ -0,0 +1,14 @@
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'
2
+
3
+ Given('a MultiSelect with onFocus handler is rendered', () => {
4
+ cy.visitStory('MultiSelect', 'With on focus')
5
+ })
6
+
7
+ Then('the onFocus handler is called', () => {
8
+ cy.window().should((win) => {
9
+ expect(win.onFocus).to.be.calledOnce
10
+ expect(win.onFocus).to.be.calledWith({
11
+ selected: [],
12
+ })
13
+ })
14
+ })
@@ -0,0 +1,6 @@
1
+ Feature: Calls onFocus cb when focused
2
+
3
+ Scenario: Focusing a MultiSelect through clicking
4
+ Given a MultiSelect with onFocus handler is rendered
5
+ When the MultiSelect input is clicked
6
+ Then the onFocus handler is called
@@ -0,0 +1,5 @@
1
+ import { Given } from '@badeball/cypress-cucumber-preprocessor'
2
+
3
+ Given('a MultiSelect with initial focus is rendered', () => {
4
+ cy.visitStory('MultiSelect', 'With initial focus')
5
+ })
@@ -0,0 +1,5 @@
1
+ Feature: Focusing the MultiSelect on mount
2
+
3
+ Scenario: The MultiSelect renders with focus
4
+ Given a MultiSelect with initial focus is rendered
5
+ Then the MultiSelect has focus