@k-int/stripes-kint-components 2.8.1 → 3.0.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 (328) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/es/index.js +54 -12
  3. package/es/lib/ActionList/ActionList.js +11 -5
  4. package/es/lib/ActionList/ActionListFieldArray.js +147 -77
  5. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +43 -31
  6. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -14
  7. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +67 -47
  8. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +17 -24
  9. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +91 -70
  10. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +53 -36
  11. package/es/lib/CustomProperties/Config/CustomPropertyView.js +50 -31
  12. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +13 -14
  13. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
  14. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +8 -12
  15. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +22 -24
  16. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +9 -12
  17. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -13
  18. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +12 -13
  19. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +91 -44
  20. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +80 -73
  21. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +31 -32
  22. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +26 -24
  23. package/es/lib/CustomProperties/Edit/testResources.js +73 -908
  24. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +21 -29
  25. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -10
  26. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +38 -39
  27. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +28 -13
  28. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +29 -44
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +6 -6
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +16 -10
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +12 -12
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +20 -11
  33. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +4 -3
  34. package/es/lib/CustomProperties/Filter/testResources.js +37 -233
  35. package/es/lib/CustomProperties/Filter/useOperators.js +69 -27
  36. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +3 -2
  37. package/es/lib/CustomProperties/Filter/useValueProps.js +7 -2
  38. package/es/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
  39. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +4 -3
  40. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +13 -19
  41. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +4 -10
  42. package/es/lib/CustomProperties/View/CustomPropertyCard.js +34 -51
  43. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +38 -28
  44. package/es/lib/EditableRefdataList/EditableRefdataList.js +44 -32
  45. package/es/lib/EditableSettingsList/EditableSettingsList.js +11 -1
  46. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +10 -0
  47. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +19 -11
  48. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
  49. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +21 -9
  50. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
  51. package/es/lib/EditableSettingsList/SettingField/SettingField.js +83 -16
  52. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +138 -65
  53. package/es/lib/FormModal/FormModal.js +14 -9
  54. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +91 -0
  55. package/es/lib/FormattedKintMessage/index.js +15 -0
  56. package/es/lib/IconSelect/IconSelect.js +18 -12
  57. package/es/lib/NoResultsMessage/NoResultsMessage.js +13 -2
  58. package/es/lib/RichSelect/RichSelect.js +13 -34
  59. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +16 -5
  60. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +11 -1
  61. package/es/lib/SettingPage/SettingPage.js +12 -13
  62. package/es/lib/SettingPage/SettingPagePane.js +12 -20
  63. package/es/lib/hooks/__mocks__/index.js +46 -0
  64. package/es/lib/hooks/index.js +24 -8
  65. package/es/lib/hooks/settingsHooks/useSettings.js +22 -17
  66. package/es/lib/hooks/useIntlKey.js +34 -0
  67. package/es/lib/hooks/useIntlKeyStore.js +84 -0
  68. package/es/lib/hooks/useKintIntl.js +93 -0
  69. package/es/lib/utils/index.js +48 -4
  70. package/es/lib/utils/parseErrorResponse.js +91 -0
  71. package/es/lib/utils/validators.js +76 -59
  72. package/jest.config.js +4 -1
  73. package/junit.xml +157 -656
  74. package/package.json +54 -33
  75. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +56 -8
  76. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +394 -64
  77. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +10 -10
  78. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
  79. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +187 -52
  80. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +372 -87
  81. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +293 -74
  82. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +126 -54
  83. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +45 -60
  84. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
  85. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +23 -5
  86. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +59 -47
  87. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +259 -97
  88. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +399 -105
  89. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +41 -68
  90. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +57 -57
  91. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
  92. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +67 -688
  93. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +92 -53
  94. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +103 -64
  95. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +54 -63
  96. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +49 -16
  97. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +69 -18
  98. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +89 -89
  99. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
  100. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +33 -786
  101. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +46 -46
  102. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +45 -36
  103. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +43 -28
  104. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +20 -2
  105. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +50 -41
  106. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +54 -75
  107. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +24 -24
  108. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
  109. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
  110. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
  111. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
  112. package/src/artifacts/coverage-jest/lcov-report/{hooks/useAvailableCustomProperties.js.html → CycleButton/CycleButton.js.html} +62 -50
  113. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +131 -0
  114. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +88 -0
  115. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +664 -0
  116. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +131 -0
  117. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +88 -0
  118. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +264 -39
  119. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +9 -9
  120. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
  121. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +41 -14
  122. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +45 -6
  123. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +47 -11
  124. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +65 -14
  125. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +154 -31
  126. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +26 -26
  127. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
  128. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +18 -18
  129. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
  130. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +35 -17
  131. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +15 -15
  132. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
  133. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +247 -0
  134. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +131 -0
  135. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +88 -0
  136. package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/CustomPropertiesView.js.html → IconSelect/IconSelect.js.html} +158 -257
  137. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +131 -0
  138. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +88 -0
  139. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +48 -6
  140. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +7 -7
  141. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
  142. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
  143. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
  144. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
  145. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +3 -3
  146. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
  147. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
  148. package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/testResources.js.html → RichSelect/RichSelect.js.html} +256 -334
  149. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +146 -0
  150. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +91 -0
  151. package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +127 -0
  152. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +52 -7
  153. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +31 -4
  154. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +3 -3
  155. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
  156. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +7 -7
  157. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
  158. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
  159. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
  160. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
  161. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
  162. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
  163. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
  164. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
  165. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
  166. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
  167. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +24 -27
  168. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +47 -17
  169. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +22 -22
  170. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
  171. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
  172. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
  173. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
  174. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
  175. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
  176. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
  177. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +2 -2
  178. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
  179. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
  180. package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
  181. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +142 -97
  182. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +13 -4
  183. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +35 -20
  184. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +5 -2
  185. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +7 -7
  186. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +7 -7
  187. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +61 -22
  188. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
  189. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
  190. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
  191. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
  192. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
  193. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +7 -7
  194. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +19 -22
  195. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +7 -7
  196. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +151 -0
  197. package/src/artifacts/coverage-jest/lcov-report/{utils/renderHelpText.js.html → hooks/useIntlKeyStore.js.html} +71 -38
  198. package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +7 -7
  199. package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +238 -0
  200. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +7 -7
  201. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +9 -9
  202. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +7 -7
  203. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +23 -11
  204. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +274 -0
  205. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +19 -10
  206. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +7 -7
  207. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +9 -9
  208. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +7 -7
  209. package/src/artifacts/coverage-jest/lcov-report/index.html +205 -130
  210. package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
  211. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
  212. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
  213. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +2 -2
  214. package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +7 -7
  215. package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
  216. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +34 -34
  217. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +42 -3
  218. package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
  219. package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +139 -0
  220. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +5 -2
  221. package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +2 -2
  222. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +2 -2
  223. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
  224. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +2 -2
  225. package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
  226. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +128 -80
  227. package/src/artifacts/coverage-jest/lcov.info +2603 -2086
  228. package/src/index.js +12 -4
  229. package/src/lib/ActionList/ActionList.js +9 -3
  230. package/src/lib/ActionList/ActionListFieldArray.js +115 -37
  231. package/src/lib/ActionList/README.md +2 -1
  232. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +60 -16
  233. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +14 -4
  234. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +109 -34
  235. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +16 -9
  236. package/src/lib/CustomProperties/Config/CustomPropertyForm.js +131 -58
  237. package/src/lib/CustomProperties/Config/CustomPropertyForm.test.js +52 -33
  238. package/src/lib/CustomProperties/Config/CustomPropertyView.js +71 -47
  239. package/src/lib/CustomProperties/Config/CustomPropertyView.test.js +8 -6
  240. package/src/lib/CustomProperties/Config/README.md +33 -28
  241. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
  242. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +7 -3
  243. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +23 -19
  244. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +5 -3
  245. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +65 -11
  246. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +10 -8
  247. package/src/lib/CustomProperties/Edit/CustomPropertyField.js +115 -21
  248. package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +59 -60
  249. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +24 -33
  250. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +20 -27
  251. package/src/lib/CustomProperties/Edit/testResources.js +46 -1047
  252. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +22 -22
  253. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -8
  254. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +44 -31
  255. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +26 -13
  256. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +33 -36
  257. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +3 -3
  258. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -8
  259. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +9 -12
  260. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +22 -5
  261. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +3 -1
  262. package/src/lib/CustomProperties/Filter/testResources.js +14 -265
  263. package/src/lib/CustomProperties/Filter/useOperators.js +20 -20
  264. package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -2
  265. package/src/lib/CustomProperties/Filter/useValueProps.js +8 -3
  266. package/src/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
  267. package/src/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -1
  268. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +15 -13
  269. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +2 -5
  270. package/src/lib/CustomProperties/View/CustomPropertyCard.js +36 -43
  271. package/src/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +47 -28
  272. package/src/lib/EditableRefdataList/EditableRefdataList.js +58 -33
  273. package/src/lib/EditableSettingsList/EditableSettingsList.js +10 -1
  274. package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.js +14 -1
  275. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.js +17 -5
  276. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
  277. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.js +24 -7
  278. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
  279. package/src/lib/EditableSettingsList/SettingField/SettingField.js +57 -16
  280. package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +14 -19
  281. package/src/lib/FormModal/FormModal.js +15 -9
  282. package/src/lib/FormattedKintMessage/FormattedKintMessage.js +54 -0
  283. package/src/lib/FormattedKintMessage/index.js +1 -0
  284. package/src/lib/IconSelect/IconSelect.js +17 -8
  285. package/src/lib/NoResultsMessage/NoResultsMessage.js +15 -1
  286. package/src/lib/RichSelect/RichSelect.js +16 -36
  287. package/src/lib/SASQLookupComponent/SASQLookupComponent.js +17 -2
  288. package/src/lib/SASQLookupComponent/TableBody/TableBody.js +10 -1
  289. package/src/lib/SettingPage/SettingPage.js +12 -13
  290. package/src/lib/SettingPage/SettingPagePane.js +16 -6
  291. package/src/lib/hooks/__mocks__/index.js +17 -0
  292. package/src/lib/hooks/index.js +3 -1
  293. package/src/lib/hooks/settingsHooks/useSettings.js +25 -12
  294. package/src/lib/hooks/useIntlKey.js +22 -0
  295. package/src/lib/hooks/useIntlKeyStore.js +38 -0
  296. package/src/lib/hooks/useKintIntl.js +51 -0
  297. package/src/lib/utils/index.js +14 -1
  298. package/src/lib/utils/parseErrorResponse.js +18 -0
  299. package/src/lib/utils/validators.js +57 -41
  300. package/styles/RichSelect.css +7 -4
  301. package/test/helpers/test-implementor-translations.json +80 -0
  302. package/test/helpers/translationsProperties.js +6 -1
  303. package/test/jest/customProperties.js +166 -0
  304. package/test/jest/helpers/KintHarness.js +1 -1
  305. package/test/jest/helpers/renderWithKintHarness.js +2 -1
  306. package/test/jest/index.js +8 -0
  307. package/test/jest/refdata.js +471 -0
  308. package/test/jest/resolver.js +29 -0
  309. package/translations/stripes-kint-components/ar.json +1 -122
  310. package/translations/stripes-kint-components/cs_CZ.json +1 -122
  311. package/translations/stripes-kint-components/de.json +1 -122
  312. package/translations/stripes-kint-components/en.json +1 -148
  313. package/translations/stripes-kint-components/es.json +1 -122
  314. package/translations/stripes-kint-components/hi_IN.json +1 -122
  315. package/translations/stripes-kint-components/hu.json +1 -122
  316. package/translations/stripes-kint-components/it_IT.json +1 -122
  317. package/translations/stripes-kint-components/ja.json +1 -122
  318. package/translations/stripes-kint-components/ko.json +1 -122
  319. package/translations/stripes-kint-components/pt_PT.json +1 -122
  320. package/translations/stripes-kint-components/ru.json +1 -122
  321. package/translations/stripes-kint-components/sv.json +1 -122
  322. package/translations/stripes-kint-components/zh_CN.json +1 -122
  323. package/es/lib/CustomProperties/Config/testResources.js +0 -198
  324. package/es/lib/hooks/useAvailableCustomProperties.js +0 -73
  325. package/es/lib/utils/renderHelpText.js +0 -80
  326. package/src/lib/CustomProperties/Config/testResources.js +0 -236
  327. package/src/lib/hooks/useAvailableCustomProperties.js +0 -40
  328. package/src/lib/utils/renderHelpText.js +0 -27
@@ -16,7 +16,7 @@ var _testResources = require("./testResources");
16
16
 
17
17
  var _CustomPropertiesListField = _interopRequireDefault(require("./CustomPropertiesListField"));
18
18
 
19
- var _helpers2 = require("../../../../test/jest/helpers");
19
+ var _jest = require("../../../../test/jest");
20
20
 
21
21
  var _jsxRuntime = require("react/jsx-runtime");
22
22
 
@@ -28,13 +28,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
28
28
 
29
29
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
30
30
 
31
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
-
33
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
34
-
35
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
36
-
37
31
  var onSubmit = jest.fn();
32
+ jest.mock('../../hooks');
38
33
  jest.mock('./CustomPropertyFormCard', function () {
39
34
  return function () {
40
35
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -45,19 +40,23 @@ jest.mock('./CustomPropertyFormCard', function () {
45
40
  describe('CustomPropertiesListField', function () {
46
41
  var renderComponent;
47
42
  beforeEach(function () {
48
- renderComponent = (0, _helpers2.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
43
+ renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
49
44
  initialValues: _testResources.initialValues,
50
45
  onSubmit: onSubmit,
51
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesListField.default, _objectSpread({}, _testResources.data))
46
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesListField.default, {
47
+ ctx: "isNull",
48
+ customProperties: _jest.customProperties,
49
+ name: "customProperties"
50
+ })
52
51
  }));
53
52
  });
54
- test('displays expected Primary terms key value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
53
+ test('displays expected primary properties key value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
55
54
  return _regeneratorRuntime().wrap(function _callee$(_context) {
56
55
  while (1) {
57
56
  switch (_context.prev = _context.next) {
58
57
  case 0:
59
58
  _context.next = 2;
60
- return (0, _stripesTesting.KeyValue)('Primary terms').exists();
59
+ return (0, _stripesTesting.KeyValue)('Primary properties').exists();
61
60
 
62
61
  case 2:
63
62
  case "end":
@@ -66,13 +65,13 @@ describe('CustomPropertiesListField', function () {
66
65
  }
67
66
  }, _callee);
68
67
  })));
69
- test('displays expected Optional terms key value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
68
+ test('displays expected optional properties key value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
70
69
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
71
70
  while (1) {
72
71
  switch (_context2.prev = _context2.next) {
73
72
  case 0:
74
73
  _context2.next = 2;
75
- return (0, _stripesTesting.KeyValue)('Optional terms').exists();
74
+ return (0, _stripesTesting.KeyValue)('Optional properties').exists();
76
75
 
77
76
  case 2:
78
77
  case "end":
@@ -9,15 +9,15 @@ exports.default = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _reactIntl = require("react-intl");
13
-
14
12
  var _reactFinalForm = require("react-final-form");
15
13
 
16
14
  var _components = require("@folio/stripes/components");
17
15
 
18
16
  var CUSTOM_PROPERTY_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
19
17
 
20
- var _validators = require("../../utils/validators");
18
+ var _hooks = require("../../hooks");
19
+
20
+ var _utils = require("../../utils");
21
21
 
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
 
@@ -51,13 +51,66 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
51
51
  customPropertyType = _ref.customPropertyType,
52
52
  customProperties = _ref.customProperties,
53
53
  index = _ref.index,
54
+ passedIntlKey = _ref.intlKey,
55
+ passedIntlNS = _ref.intlNS,
54
56
  _ref$labelOverrides = _ref.labelOverrides,
55
57
  labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
56
58
  name = _ref.name,
57
59
  _onChange = _ref.onChange,
58
60
  value = _ref.value,
59
61
  setCustomProperties = _ref.setCustomProperties;
60
- var intl = (0, _reactIntl.useIntl)();
62
+ var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS); // Set up the validator for the customProperty
63
+
64
+ var customPropertyValidator = function customPropertyValidator(fieldValue, allValues) {
65
+ var _allValues$customProp, _allValues$customProp2, _allValues$customProp3;
66
+
67
+ var _ref2 = (_allValues$customProp = allValues === null || allValues === void 0 ? void 0 : (_allValues$customProp2 = allValues.customProperties) === null || _allValues$customProp2 === void 0 ? void 0 : (_allValues$customProp3 = _allValues$customProp2[customProperty === null || customProperty === void 0 ? void 0 : customProperty.value]) === null || _allValues$customProp3 === void 0 ? void 0 : _allValues$customProp3[0]) !== null && _allValues$customProp !== void 0 ? _allValues$customProp : {},
68
+ note = _ref2.note,
69
+ publicNote = _ref2.publicNote,
70
+ currentValue = _ref2.value;
71
+
72
+ if (note && !currentValue || publicNote && !currentValue) {
73
+ if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME || customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
74
+ return kintIntl.formatKintMessage({
75
+ id: 'customProperties.errors.customPropertyNoteInvalidNumber',
76
+ overrideValue: labelOverrides.customPropertyNoteInvalidNumberError
77
+ });
78
+ } else {
79
+ return kintIntl.formatKintMessage({
80
+ id: 'customProperties.errors.customPropertyNoteWithoutValue',
81
+ overrideValue: labelOverrides.customPropertyNoteWithoutValueError
82
+ });
83
+ }
84
+ }
85
+
86
+ if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME) {
87
+ var regexp = /^-?[\d]*(\.[\d]{0,2})?$/;
88
+ return fieldValue && !regexp.test(fieldValue) ? kintIntl.formatKintMessage({
89
+ id: 'errors.maxTwoDecimals',
90
+ overrideValue: labelOverrides.maxTwoDecimalsError
91
+ }) : undefined;
92
+ }
93
+
94
+ if (customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
95
+ var min = Number.MIN_SAFE_INTEGER;
96
+ var max = Number.MAX_SAFE_INTEGER;
97
+ return fieldValue && !Number.isInteger(+fieldValue) ? kintIntl.formatKintMessage({
98
+ id: 'errors.valueNotInRange',
99
+ overrideValue: labelOverrides.valueNotInRangeError
100
+ }, {
101
+ min: min,
102
+ max: max
103
+ }) : undefined;
104
+ }
105
+
106
+ if (!customProperty.primary && !currentValue) {
107
+ return kintIntl.formatMessage({
108
+ id: 'stripes-core.label.missingRequiredField'
109
+ });
110
+ }
111
+
112
+ return undefined;
113
+ };
61
114
 
62
115
  var getCustomProperty = function getCustomProperty(customPropertyValue) {
63
116
  return availableCustomProperties.find(function (cp) {
@@ -66,7 +119,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
66
119
  };
67
120
 
68
121
  var renderCustomPropertyName = function renderCustomPropertyName() {
69
- var _customPropertyValue$, _labelOverrides$name;
122
+ var _customPropertyValue$;
70
123
 
71
124
  var unsetCustomProperties = availableCustomProperties.filter(function (t) {
72
125
  var _custPropValue$;
@@ -87,8 +140,9 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
87
140
  dataOptions: [customProperty].concat(_toConsumableArray(unsetCustomProperties)) // The selected customProperty, and the available unset customProperties
88
141
  ,
89
142
  id: "edit-customproperty-".concat(index, "-name"),
90
- label: (_labelOverrides$name = labelOverrides.name) !== null && _labelOverrides$name !== void 0 ? _labelOverrides$name : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
91
- id: "stripes-kint-components.customProperty.name"
143
+ label: kintIntl.formatKintMessage({
144
+ id: 'customProperties.name',
145
+ overrideValue: labelOverrides.name
92
146
  }),
93
147
  onChange: function onChange(e) {
94
148
  var _objectSpread2;
@@ -116,7 +170,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
116
170
  };
117
171
 
118
172
  var renderCustomPropertyValue = function renderCustomPropertyValue() {
119
- var _customProperty$optio, _labelOverrides$value;
173
+ var _customProperty$optio;
120
174
 
121
175
  var currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
122
176
  var min = Number.MIN_SAFE_INTEGER;
@@ -168,26 +222,14 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
168
222
  case CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME:
169
223
  case CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME:
170
224
  fieldProps = {
171
- badInput: intl.formatMessage({
172
- id: 'stripes-kint-components.errors.customPropertyInvalidNumber'
173
- }),
174
225
  component: _components.TextField,
175
226
  max: max,
176
227
  min: min,
177
- rangeOverflow: intl.formatMessage({
178
- id: 'stripes-kint-components.errors.customPropertyDecimalValueNotInRange'
179
- }, {
180
- min: min,
181
- max: max
182
- }),
183
- rangeUnderflow: intl.formatMessage({
184
- id: 'stripes-kint-components.errors.customPropertyDecimalValueNotInRange'
185
- }, {
186
- min: min,
187
- max: max
188
- }),
189
228
  step: 'any',
190
- type: 'number'
229
+ type: 'number',
230
+ validate: function validate(validateValue) {
231
+ return (0, _utils.composeValidatorsWithArgs)(_utils.invalidNumber, _utils.rangeOverflow, _utils.rangeUnderflow)(validateValue, min, max, passedIntlKey, passedIntlNS, labelOverrides);
232
+ }
191
233
  };
192
234
 
193
235
  handleChange = function handleChange(e) {
@@ -229,23 +271,21 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
229
271
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, _objectSpread({
230
272
  "data-test-customproperty-value": true,
231
273
  id: "edit-customproperty-".concat(index, "-value"),
232
- label: (_labelOverrides$value = labelOverrides.value) !== null && _labelOverrides$value !== void 0 ? _labelOverrides$value : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
233
- id: "stripes-kint-components.customProperty.value"
274
+ label: kintIntl.formatKintMessage({
275
+ id: 'customProperties.value',
276
+ overrideValue: labelOverrides.value
234
277
  }),
235
278
  name: "".concat(name, ".").concat(customProperty.value, "[0].value"),
236
279
  onChange: handleChange,
237
280
  required: !customProperty.primary,
238
281
  validate: function validate(fieldValue, allValues) {
239
- return (0, _validators.customPropertyValidator)(fieldValue, allValues, customProperty);
240
- },
241
- valueMissing: intl.formatMessage({
242
- id: 'stripes-core.label.missingRequiredField'
243
- })
282
+ return customPropertyValidator(fieldValue, allValues);
283
+ }
244
284
  }, fieldProps));
245
285
  };
246
286
 
247
287
  var renderCustomPropertyVisibility = function renderCustomPropertyVisibility() {
248
- var _value$customProperty, _value$customProperty2, _labelOverrides$visib, _customPropertyObject;
288
+ var _value$customProperty, _value$customProperty2, _customPropertyObject;
249
289
 
250
290
  var customPropertyObject = (_value$customProperty = (_value$customProperty2 = value[customProperty.value]) === null || _value$customProperty2 === void 0 ? void 0 : _value$customProperty2[0]) !== null && _value$customProperty !== void 0 ? _value$customProperty : {};
251
291
 
@@ -259,18 +299,21 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
259
299
  "data-test-customproperty-visibility": true,
260
300
  dataOptions: [{
261
301
  value: true,
262
- label: intl.formatMessage({
263
- id: 'stripes-kint-components.customProperty.internalTrue'
302
+ label: kintIntl.formatKintMessage({
303
+ id: 'customProperties.internalTrue',
304
+ overrideValue: labelOverrides.internalTrue
264
305
  })
265
306
  }, {
266
307
  value: false,
267
- label: intl.formatMessage({
268
- id: 'stripes-kint-components.customProperty.internalFalse'
308
+ label: kintIntl.formatKintMessage({
309
+ id: 'customProperties.internalFalse',
310
+ overrideValue: labelOverrides.internalFalse
269
311
  })
270
312
  }],
271
313
  id: "edit-customproperty-".concat(index, "-visibility"),
272
- label: (_labelOverrides$visib = labelOverrides.visibility) !== null && _labelOverrides$visib !== void 0 ? _labelOverrides$visib : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
273
- id: "stripes-kint-components.customProperty.visibility"
314
+ label: kintIntl.formatKintMessage({
315
+ id: 'customProperties.visibility',
316
+ overrideValue: labelOverrides.visibility
274
317
  }),
275
318
  onChange: handleChange,
276
319
  value: (_customPropertyObject = customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.internal) !== null && _customPropertyObject !== void 0 ? _customPropertyObject : customProperty.defaultInternal
@@ -278,7 +321,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
278
321
  };
279
322
 
280
323
  var renderCustomPropertyNoteInternal = function renderCustomPropertyNoteInternal() {
281
- var _value$customProperty3, _value$customProperty4, _labelOverrides$inter;
324
+ var _value$customProperty3, _value$customProperty4;
282
325
 
283
326
  var customPropertyObject = (_value$customProperty3 = (_value$customProperty4 = value[customProperty.value]) === null || _value$customProperty4 === void 0 ? void 0 : _value$customProperty4[0]) !== null && _value$customProperty3 !== void 0 ? _value$customProperty3 : {};
284
327
 
@@ -291,8 +334,9 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
291
334
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
292
335
  "data-test-customproperty-note": true,
293
336
  id: "edit-customproperty-".concat(index, "-internal-note"),
294
- label: (_labelOverrides$inter = labelOverrides.internalNote) !== null && _labelOverrides$inter !== void 0 ? _labelOverrides$inter : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
295
- id: "stripes-kint-components.customProperty.internalNote"
337
+ label: kintIntl.formatKintMessage({
338
+ id: 'customProperties.internalNote',
339
+ overrideValue: labelOverrides.internalNote
296
340
  }),
297
341
  onChange: handleChange,
298
342
  value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.note
@@ -300,7 +344,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
300
344
  };
301
345
 
302
346
  var renderCustomPropertyNotePublic = function renderCustomPropertyNotePublic() {
303
- var _value$customProperty5, _value$customProperty6, _labelOverrides$publi;
347
+ var _value$customProperty5, _value$customProperty6;
304
348
 
305
349
  var customPropertyObject = (_value$customProperty5 = (_value$customProperty6 = value[customProperty.value]) === null || _value$customProperty6 === void 0 ? void 0 : _value$customProperty6[0]) !== null && _value$customProperty5 !== void 0 ? _value$customProperty5 : {};
306
350
 
@@ -313,8 +357,9 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
313
357
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
314
358
  "data-test-customproperty-public-note": true,
315
359
  id: "edit-customproperty-".concat(index, "-public-note"),
316
- label: (_labelOverrides$publi = labelOverrides.publicNote) !== null && _labelOverrides$publi !== void 0 ? _labelOverrides$publi : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
317
- id: "stripes-kint-components.customProperty.publicNote"
360
+ label: kintIntl.formatKintMessage({
361
+ id: 'customProperties.publicNote',
362
+ overrideValue: labelOverrides.publicNote
318
363
  }),
319
364
  onChange: handleChange,
320
365
  value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.publicNote
@@ -360,6 +405,8 @@ CustomPropertyField.propTypes = {
360
405
  customPropertyType: _propTypes.default.string,
361
406
  customProperties: _propTypes.default.arrayOf(_propTypes.default.object),
362
407
  index: _propTypes.default.number,
408
+ intlKey: _propTypes.default.string,
409
+ intlNS: _propTypes.default.string,
363
410
  labelOverrides: _propTypes.default.object,
364
411
  name: _propTypes.default.string,
365
412
  onChange: _propTypes.default.func,
@@ -12,66 +12,83 @@ var _helpers = require("@folio/stripes-erm-components/test/jest/helpers");
12
12
 
13
13
  var _CustomPropertyField = _interopRequireDefault(require("./CustomPropertyField"));
14
14
 
15
- var _testResources = require("./testResources");
15
+ var _jest = require("../../../../test/jest");
16
16
 
17
- var _helpers2 = require("../../../../test/jest/helpers");
17
+ var _testResources = require("./testResources");
18
18
 
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
20
 
21
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
22
 
23
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
24
-
25
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
26
-
27
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28
-
29
23
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
30
24
 
31
25
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
32
26
 
33
27
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
34
28
 
29
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
30
+
31
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
32
+
33
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
34
+
35
35
  var onSubmit = jest.fn();
36
+ jest.mock('../../hooks');
36
37
 
37
38
  var onChange = function onChange() {};
38
39
 
39
40
  var setCustomProperties = function setCustomProperties() {};
40
41
 
42
+ var authIdentCustom = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(function (cp) {
43
+ return cp.value === 'AuthorIdentification';
44
+ });
45
+ var decimalCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(function (cp) {
46
+ return cp.value === 'decimal';
47
+ });
48
+ var integerCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(function (cp) {
49
+ return cp.value === 'integer';
50
+ });
51
+ var dateCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(function (cp) {
52
+ return cp.value === 'date';
53
+ });
54
+ var multiRefdataCustProp = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(function (cp) {
55
+ return cp.value === 'MultiRefdata';
56
+ });
57
+ var defaultProps = {
58
+ availableCustomProperties: _jest.availableCustomProperties,
59
+ customProperties: _jest.customProperties,
60
+ customPropertyType: 'primary',
61
+ internalPropertyCounter: 1,
62
+ name: 'customProperties',
63
+ onChange: onChange,
64
+ setCustomProperties: setCustomProperties,
65
+ value: _testResources.value
66
+ };
41
67
  describe('CustomPropertyField', function () {
42
68
  var renderComponent;
43
69
  describe('CustomPropertyField', function () {
44
70
  beforeEach(function () {
45
- renderComponent = (0, _helpers2.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
71
+ renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
46
72
  initialValues: _testResources.initialValues,
47
73
  onSubmit: onSubmit,
48
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, {
49
- availableCustomProperties: _testResources.availableCustomProperties,
50
- customProperties: _testResources.customProperties,
51
- customProperty: _testResources.customProperty,
52
- customPropertyType: "primary",
53
- index: 0,
54
- internalPropertyCounter: 1,
55
- labelOverrides: _testResources.labelOverrides,
56
- name: "customProperties",
57
- onChange: onChange,
58
- setCustomProperties: setCustomProperties,
59
- value: _testResources.value
60
- })
74
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
75
+ customProperty: authIdentCustom,
76
+ index: 0
77
+ }))
61
78
  }));
62
79
  var _renderComponent = renderComponent,
63
80
  getByTestId = _renderComponent.getByTestId;
64
81
  expect(getByTestId('customPropertyField')).toBeInTheDocument();
65
82
  });
66
- it('Displays expected value(s) lable ', function () {
83
+ it('Displays expected value(s) label ', function () {
67
84
  var _renderComponent2 = renderComponent,
68
85
  getByText = _renderComponent2.getByText;
69
86
  expect(getByText('Value(s)')).toBeInTheDocument();
70
87
  });
71
- test('Displays expected Valu(s) dropdwon values ', function () {
88
+ test('Displays expected Value(s) dropdown values ', function () {
72
89
  (0, _stripesTesting.MultiSelect)('Value(s)').select(['Not set', 'ORCID', 'Ringgold ID', 'Email Domain', 'Over IP Range', 'FOR ID', 'Other', 'Over Institute']);
73
90
  });
74
- it('Displays expected Internal note lable ', function () {
91
+ it('Displays expected Internal note label ', function () {
75
92
  var _renderComponent3 = renderComponent,
76
93
  getByText = _renderComponent3.getByText;
77
94
  expect(getByText('Internal note')).toBeInTheDocument();
@@ -82,10 +99,8 @@ describe('CustomPropertyField', function () {
82
99
  switch (_context.prev = _context.next) {
83
100
  case 0:
84
101
  _context.next = 2;
85
- return (0, _stripesTesting.TextArea)({
86
- id: 'edit-customproperty-0-internal-note'
87
- }).has({
88
- value: 'internal note'
102
+ return (0, _stripesTesting.TextArea)('Internal note').has({
103
+ value: 'this is an internal note'
89
104
  });
90
105
 
91
106
  case 2:
@@ -98,7 +113,7 @@ describe('CustomPropertyField', function () {
98
113
  test('Displays expected visibilities dropdwon values ', function () {
99
114
  (0, _stripesTesting.MultiSelect)('Visibility').select(['Internal', 'Public']);
100
115
  });
101
- it('Displays expected Public note lable ', function () {
116
+ it('Displays expected Public note label ', function () {
102
117
  var _renderComponent4 = renderComponent,
103
118
  getByText = _renderComponent4.getByText;
104
119
  expect(getByText('Public note')).toBeInTheDocument();
@@ -109,10 +124,8 @@ describe('CustomPropertyField', function () {
109
124
  switch (_context2.prev = _context2.next) {
110
125
  case 0:
111
126
  _context2.next = 2;
112
- return (0, _stripesTesting.TextArea)({
113
- id: 'edit-customproperty-0-public-note'
114
- }).has({
115
- value: 'public note'
127
+ return (0, _stripesTesting.TextArea)('Public note').has({
128
+ value: 'this is a public note'
116
129
  });
117
130
 
118
131
  case 2:
@@ -125,13 +138,12 @@ describe('CustomPropertyField', function () {
125
138
  });
126
139
  describe('Decimal field', function () {
127
140
  beforeEach(function () {
128
- renderComponent = (0, _helpers2.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
141
+ renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
129
142
  initialValues: _testResources.initialValues,
130
143
  onSubmit: onSubmit,
131
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, _testResources.decimalData), {}, {
132
- availableCustomProperties: _testResources.availableCustomProperties,
133
- onChange: onChange,
134
- setCustomProperties: setCustomProperties
144
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
145
+ customProperty: decimalCustProp,
146
+ index: 2
135
147
  }))
136
148
  }));
137
149
  });
@@ -155,13 +167,12 @@ describe('CustomPropertyField', function () {
155
167
  });
156
168
  describe('Integer field', function () {
157
169
  beforeEach(function () {
158
- renderComponent = (0, _helpers2.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
170
+ renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
159
171
  initialValues: _testResources.initialValues,
160
172
  onSubmit: onSubmit,
161
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, _testResources.integerData), {}, {
162
- availableCustomProperties: _testResources.availableCustomProperties,
163
- onChange: onChange,
164
- setCustomProperties: setCustomProperties
173
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
174
+ customProperty: integerCustProp,
175
+ index: 3
165
176
  }))
166
177
  }));
167
178
  });
@@ -185,25 +196,24 @@ describe('CustomPropertyField', function () {
185
196
  }, _callee4);
186
197
  })));
187
198
  });
188
- describe('Date field', function () {
199
+ describe('Refdata multi-select field', function () {
189
200
  beforeEach(function () {
190
- renderComponent = (0, _helpers2.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
201
+ renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
191
202
  initialValues: _testResources.initialValues,
192
203
  onSubmit: onSubmit,
193
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, _testResources.dateData), {}, {
194
- availableCustomProperties: _testResources.availableCustomProperties,
195
- onChange: onChange,
196
- setCustomProperties: setCustomProperties
204
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
205
+ customProperty: multiRefdataCustProp,
206
+ index: 4
197
207
  }))
198
208
  }));
199
209
  });
200
- test('renders values DatePicker', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
210
+ test('Displays expected multi-select Refdata Field', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
201
211
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
202
212
  while (1) {
203
213
  switch (_context5.prev = _context5.next) {
204
214
  case 0:
205
215
  _context5.next = 2;
206
- return (0, _stripesTesting.Datepicker)('Value(s)').exists();
216
+ return (0, _stripesTesting.MultiSelect)('Value(s)').exists();
207
217
 
208
218
  case 2:
209
219
  case "end":
@@ -212,15 +222,18 @@ describe('CustomPropertyField', function () {
212
222
  }
213
223
  }, _callee5);
214
224
  })));
215
- test('Displays expected date Field', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
225
+ it('Displays expected value(s) label ', function () {
226
+ var _renderComponent5 = renderComponent,
227
+ getByText = _renderComponent5.getByText;
228
+ expect(getByText('Value(s)')).toBeInTheDocument();
229
+ });
230
+ test('renders multi-select Refdata values', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
216
231
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
217
232
  while (1) {
218
233
  switch (_context6.prev = _context6.next) {
219
234
  case 0:
220
235
  _context6.next = 2;
221
- return (0, _stripesTesting.TextInput)({
222
- id: 'edit-customproperty-5-value'
223
- }).exists();
236
+ return (0, _stripesTesting.MultiSelect)('Value(s)').select(['Future', 'Current', 'Historical', 'Does not apply']);
224
237
 
225
238
  case 2:
226
239
  case "end":
@@ -230,27 +243,24 @@ describe('CustomPropertyField', function () {
230
243
  }, _callee6);
231
244
  })));
232
245
  });
233
- describe('Refdata multi-select field', function () {
246
+ describe('Date field', function () {
234
247
  beforeEach(function () {
235
- renderComponent = (0, _helpers2.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
248
+ renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_helpers.TestForm, {
236
249
  initialValues: _testResources.initialValues,
237
250
  onSubmit: onSubmit,
238
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, _testResources.multiSelectData), {}, {
239
- availableCustomProperties: _testResources.availableCustomProperties,
240
- onChange: onChange,
241
- setCustomProperties: setCustomProperties
251
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, _objectSpread(_objectSpread({}, defaultProps), {}, {
252
+ customProperty: dateCustProp,
253
+ index: 5
242
254
  }))
243
255
  }));
244
256
  });
245
- test('Displays expected multi-select Refdata Field', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
257
+ test('renders values DatePicker', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
246
258
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
247
259
  while (1) {
248
260
  switch (_context7.prev = _context7.next) {
249
261
  case 0:
250
262
  _context7.next = 2;
251
- return (0, _stripesTesting.TextInput)({
252
- id: 'edit-customproperty-4-value-input'
253
- }).exists();
263
+ return (0, _stripesTesting.Datepicker)('Value(s)').exists();
254
264
 
255
265
  case 2:
256
266
  case "end":
@@ -259,18 +269,15 @@ describe('CustomPropertyField', function () {
259
269
  }
260
270
  }, _callee7);
261
271
  })));
262
- it('Displays expected value(s) lable ', function () {
263
- var _renderComponent5 = renderComponent,
264
- getByText = _renderComponent5.getByText;
265
- expect(getByText('Value(s)')).toBeInTheDocument();
266
- });
267
- test('renders multi-select Refdata values', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
272
+ test('Displays expected date Field', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
268
273
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
269
274
  while (1) {
270
275
  switch (_context8.prev = _context8.next) {
271
276
  case 0:
272
277
  _context8.next = 2;
273
- return (0, _stripesTesting.MultiSelect)('Value(s)').select(['Ceased', 'Superseded', 'Rejected', 'Cancelled']);
278
+ return (0, _stripesTesting.TextInput)({
279
+ id: 'edit-customproperty-5-value'
280
+ }).exists();
274
281
 
275
282
  case 2:
276
283
  case "end":