@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
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
- var _reactIntl = require("react-intl");
15
-
16
14
  var _components = require("@folio/stripes/components");
17
15
 
18
16
  var _EditSettingValue = _interopRequireDefault(require("./EditSettingValue"));
@@ -25,6 +23,8 @@ var _hooks = require("../../hooks");
25
23
 
26
24
  var _utils = require("../../utils");
27
25
 
26
+ var _renderHelpText = _interopRequireDefault(require("../../../../styles/renderHelpText.css"));
27
+
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
 
30
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -52,7 +52,11 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
52
52
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
53
53
 
54
54
  var SettingField = function SettingField(settingFieldProps) {
55
- var onSave = settingFieldProps.onSave,
55
+ var passedIntlKey = settingFieldProps.intlKey,
56
+ passedIntlNS = settingFieldProps.intlNS,
57
+ _settingFieldProps$la = settingFieldProps.labelOverrides,
58
+ labelOverrides = _settingFieldProps$la === void 0 ? {} : _settingFieldProps$la,
59
+ onSave = settingFieldProps.onSave,
56
60
  _settingFieldProps$se = settingFieldProps.settingData;
57
61
  _settingFieldProps$se = _settingFieldProps$se === void 0 ? {} : _settingFieldProps$se;
58
62
  var currentSetting = _settingFieldProps$se.currentSetting;
@@ -62,10 +66,9 @@ var SettingField = function SettingField(settingFieldProps) {
62
66
  editing = _useState2[0],
63
67
  setEditing = _useState2[1];
64
68
 
65
- var intl = (0, _reactIntl.useIntl)();
69
+ var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
66
70
 
67
71
  var _useContext = (0, _react.useContext)(_contexts.SettingsContext),
68
- intlKey = _useContext.intlKey,
69
72
  refdataEndpoint = _useContext.refdataEndpoint,
70
73
  templateEndpoint = _useContext.templateEndpoint;
71
74
 
@@ -89,13 +92,74 @@ var SettingField = function SettingField(settingFieldProps) {
89
92
  }
90
93
  });
91
94
 
95
+ var renderHelpText = function renderHelpText(helpTextId) {
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
97
+ className: _renderHelpText.default.help,
98
+ children: kintIntl.formatKintMessage({
99
+ id: helpTextId
100
+ }, {
101
+ b: function b(chunks) {
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("b", {
103
+ children: chunks
104
+ });
105
+ },
106
+ i: function i(chunks) {
107
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
108
+ children: chunks
109
+ });
110
+ },
111
+ em: function em(chunks) {
112
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
113
+ children: chunks
114
+ });
115
+ },
116
+ strong: function strong(chunks) {
117
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
118
+ children: chunks
119
+ });
120
+ },
121
+ span: function span(chunks) {
122
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
123
+ children: chunks
124
+ });
125
+ },
126
+ div: function div(chunks) {
127
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
128
+ children: chunks
129
+ });
130
+ },
131
+ p: function p(chunks) {
132
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
133
+ children: chunks
134
+ });
135
+ },
136
+ ul: function ul(chunks) {
137
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
138
+ children: chunks
139
+ });
140
+ },
141
+ ol: function ol(chunks) {
142
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("ol", {
143
+ children: chunks
144
+ });
145
+ },
146
+ li: function li(chunks) {
147
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
148
+ children: chunks
149
+ });
150
+ }
151
+ })
152
+ });
153
+ };
154
+
92
155
  var renderEditButton = function renderEditButton() {
93
- var EditText = editing ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
94
- id: "stripes-kint-components.settings.finishEditing"
95
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
96
- id: "stripes-kint-components.settings.edit"
156
+ var EditText = editing ? kintIntl.formatKintMessage({
157
+ id: 'save'
158
+ }) : kintIntl.formatKintMessage({
159
+ id: 'edit'
97
160
  });
98
161
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
162
+ marginBottom0: true,
99
163
  onClick: function onClick(e) {
100
164
  e.preventDefault();
101
165
  return editing ? onSave().then(function () {
@@ -114,17 +178,17 @@ var SettingField = function SettingField(settingFieldProps) {
114
178
  RenderFunction = _EditSettingValue.default;
115
179
  }
116
180
 
117
- var id = "".concat(intlKey, ".settings.").concat((0, _utils.toCamelCase)(currentSetting.section), ".").concat((0, _utils.toCamelCase)(currentSetting.key), ".help");
181
+ var id = "settings.".concat((0, _utils.toCamelCase)(currentSetting.section), ".").concat((0, _utils.toCamelCase)(currentSetting.key), ".help");
118
182
 
119
183
  var renderHeaderStart = function renderHeaderStart() {
120
- var settingName = Object.keys(currentSetting).length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
121
- id: "".concat(intlKey, ".settings.").concat((0, _utils.toCamelCase)(currentSetting.section), ".").concat((0, _utils.toCamelCase)(currentSetting.key))
122
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
123
- id: "stripes-kint-components.settings.settingLoading"
184
+ var settingName = Object.keys(currentSetting).length > 0 ? kintIntl.formatKintMessage({
185
+ id: "settings.".concat((0, _utils.toCamelCase)(currentSetting.section), ".").concat((0, _utils.toCamelCase)(currentSetting.key))
186
+ }) : kintIntl.formatKintMessage({
187
+ id: 'loading'
124
188
  });
125
189
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
126
- children: [intl.messages[id] && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
127
- content: (0, _utils.renderHelpText)(id)
190
+ children: [kintIntl.messageExists(id) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
191
+ content: renderHelpText(id)
128
192
  }), settingName]
129
193
  });
130
194
  };
@@ -135,6 +199,9 @@ var SettingField = function SettingField(settingFieldProps) {
135
199
  roundedBorder: true,
136
200
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RenderFunction, _objectSpread({
137
201
  currentSetting: currentSetting,
202
+ intlKey: passedIntlKey,
203
+ intlNS: passedIntlNS,
204
+ labelOverrides: labelOverrides,
138
205
  refdata: refdata,
139
206
  templates: templates
140
207
  }, settingFieldProps))
@@ -4,10 +4,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
 
5
5
  var _react = _interopRequireDefault(require("react"));
6
6
 
7
- var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
8
-
9
7
  require("@folio/stripes-erm-components/test/jest/__mock__");
10
8
 
9
+ var _react2 = require("@testing-library/react");
10
+
11
11
  var _helpers = require("@folio/stripes-erm-components/test/jest/helpers");
12
12
 
13
13
  var _stripesTesting = require("@folio/stripes-testing");
@@ -44,16 +44,7 @@ jest.mock('./RenderSettingValue', function () {
44
44
  });
45
45
  };
46
46
  });
47
- jest.mock('../../hooks', function () {
48
- return {
49
- useRefdata: function useRefdata() {
50
- return [];
51
- },
52
- useTemplates: function useTemplates() {
53
- return [];
54
- }
55
- };
56
- });
47
+ jest.mock('../../hooks');
57
48
  var setting = {
58
49
  id: 'ff8081817d94374a017d94449a660049',
59
50
  key: 'S3BucketName',
@@ -88,68 +79,150 @@ describe('SettingField', function () {
88
79
  }
89
80
  }, _callee);
90
81
  })));
91
- it('renders RenderSettingValue', function () {
92
- var _renderComponent = renderComponent,
93
- getByText = _renderComponent.getByText;
94
- expect(getByText('RenderSettingValue')).toBeInTheDocument();
95
- });
82
+ it('renders RenderSettingValue', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
83
+ var _renderComponent, getByText;
84
+
85
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
86
+ while (1) {
87
+ switch (_context3.prev = _context3.next) {
88
+ case 0:
89
+ _renderComponent = renderComponent, getByText = _renderComponent.getByText;
90
+ _context3.next = 3;
91
+ return (0, _react2.waitFor)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
92
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
93
+ while (1) {
94
+ switch (_context2.prev = _context2.next) {
95
+ case 0:
96
+ _context2.t0 = expect;
97
+ _context2.next = 3;
98
+ return getByText('RenderSettingValue');
99
+
100
+ case 3:
101
+ _context2.t1 = _context2.sent;
102
+ return _context2.abrupt("return", (0, _context2.t0)(_context2.t1).toBeInTheDocument());
103
+
104
+ case 5:
105
+ case "end":
106
+ return _context2.stop();
107
+ }
108
+ }
109
+ }, _callee2);
110
+ })));
111
+
112
+ case 3:
113
+ case "end":
114
+ return _context3.stop();
115
+ }
116
+ }
117
+ }, _callee3);
118
+ })));
96
119
  test('renders the edit button', function () {
97
120
  (0, _stripesTesting.Button)('Edit').exists();
98
121
  });
99
- it('clicking edit/save works as expected', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
100
- var _renderComponent2, getByRole, findByText, editButton, finishEditing;
122
+ it('clicking edit/save works as expected', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
123
+ var _renderComponent2, findByText;
101
124
 
102
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
125
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
103
126
  while (1) {
104
- switch (_context2.prev = _context2.next) {
127
+ switch (_context8.prev = _context8.next) {
105
128
  case 0:
106
- _renderComponent2 = renderComponent, getByRole = _renderComponent2.getByRole, findByText = _renderComponent2.findByText; // before clicking on edit button, we should be rendering setting value
107
-
108
- _context2.t0 = expect;
109
- _context2.next = 4;
110
- return findByText('RenderSettingValue');
111
-
112
- case 4:
113
- _context2.t1 = _context2.sent;
114
- (0, _context2.t0)(_context2.t1).toBeInTheDocument();
115
- // Clicking edit button
116
- editButton = getByRole('button', {
117
- name: /Edit/i
118
- });
119
- expect(editButton).toBeInTheDocument();
120
-
121
- _userEvent.default.click(editButton); // Should be rendering the "edit" for a setting value
122
-
123
-
124
- _context2.t2 = expect;
125
- _context2.next = 12;
126
- return findByText('EditSettingValue');
127
-
128
- case 12:
129
- _context2.t3 = _context2.sent;
130
- (0, _context2.t2)(_context2.t3).toBeInTheDocument();
131
- // Clicking finish editing button
132
- finishEditing = getByRole('button', {
133
- name: /Finish editing/i
134
- });
135
- expect(finishEditing).toBeInTheDocument();
136
-
137
- _userEvent.default.click(finishEditing); // Should be rendering the setting value again
138
-
139
-
140
- _context2.t4 = expect;
141
- _context2.next = 20;
142
- return findByText('RenderSettingValue');
143
-
144
- case 20:
145
- _context2.t5 = _context2.sent;
146
- (0, _context2.t4)(_context2.t5).toBeInTheDocument();
129
+ _renderComponent2 = renderComponent, findByText = _renderComponent2.findByText; // before clicking on edit button, we should be rendering setting value
130
+
131
+ _context8.next = 3;
132
+ return (0, _react2.waitFor)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
133
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
134
+ while (1) {
135
+ switch (_context4.prev = _context4.next) {
136
+ case 0:
137
+ _context4.t0 = expect;
138
+ _context4.next = 3;
139
+ return findByText('RenderSettingValue');
140
+
141
+ case 3:
142
+ _context4.t1 = _context4.sent;
143
+ return _context4.abrupt("return", (0, _context4.t0)(_context4.t1).toBeInTheDocument());
144
+
145
+ case 5:
146
+ case "end":
147
+ return _context4.stop();
148
+ }
149
+ }
150
+ }, _callee4);
151
+ })));
152
+
153
+ case 3:
154
+ _context8.next = 5;
155
+ return (0, _stripesTesting.Button)('Edit').click();
156
+
157
+ case 5:
158
+ _context8.next = 7;
159
+ return (0, _react2.waitFor)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
160
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
161
+ while (1) {
162
+ switch (_context5.prev = _context5.next) {
163
+ case 0:
164
+ _context5.t0 = expect;
165
+ _context5.next = 3;
166
+ return findByText('EditSettingValue');
167
+
168
+ case 3:
169
+ _context5.t1 = _context5.sent;
170
+ return _context5.abrupt("return", (0, _context5.t0)(_context5.t1).toBeInTheDocument());
171
+
172
+ case 5:
173
+ case "end":
174
+ return _context5.stop();
175
+ }
176
+ }
177
+ }, _callee5);
178
+ })));
179
+
180
+ case 7:
181
+ _context8.next = 9;
182
+ return (0, _react2.waitFor)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
183
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
184
+ while (1) {
185
+ switch (_context6.prev = _context6.next) {
186
+ case 0:
187
+ _context6.next = 2;
188
+ return (0, _stripesTesting.Button)('Save').click();
189
+
190
+ case 2:
191
+ case "end":
192
+ return _context6.stop();
193
+ }
194
+ }
195
+ }, _callee6);
196
+ })));
197
+
198
+ case 9:
199
+ _context8.next = 11;
200
+ return (0, _react2.waitFor)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
201
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
202
+ while (1) {
203
+ switch (_context7.prev = _context7.next) {
204
+ case 0:
205
+ _context7.t0 = expect;
206
+ _context7.next = 3;
207
+ return findByText('RenderSettingValue');
208
+
209
+ case 3:
210
+ _context7.t1 = _context7.sent;
211
+ return _context7.abrupt("return", (0, _context7.t0)(_context7.t1).toBeInTheDocument());
212
+
213
+ case 5:
214
+ case "end":
215
+ return _context7.stop();
216
+ }
217
+ }
218
+ }, _callee7);
219
+ })));
147
220
 
148
- case 22:
221
+ case 11:
149
222
  case "end":
150
- return _context2.stop();
223
+ return _context8.stop();
151
224
  }
152
225
  }
153
- }, _callee2);
226
+ }, _callee8);
154
227
  })));
155
228
  });
@@ -9,14 +9,14 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
10
  var _reactFinalForm = require("react-final-form");
11
11
 
12
- var _reactIntl = require("react-intl");
13
-
14
12
  var _components = require("@folio/stripes/components");
15
13
 
14
+ var _hooks = require("../hooks");
15
+
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
 
18
18
  var _excluded = ["footer", "onClose"],
19
- _excluded2 = ["children", "labelOverrides", "modalProps", "onSubmit"];
19
+ _excluded2 = ["children", "intlKey", "intlNS", "labelOverrides", "modalProps", "onSubmit"];
20
20
 
21
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
22
 
@@ -32,6 +32,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
32
32
 
33
33
  var FormModal = function FormModal(_ref) {
34
34
  var _children = _ref.children,
35
+ passedIntlKey = _ref.intlKey,
36
+ passedIntlNS = _ref.intlNS,
35
37
  _ref$labelOverrides = _ref.labelOverrides,
36
38
  labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
37
39
  _ref$modalProps = _ref.modalProps,
@@ -41,6 +43,7 @@ var FormModal = function FormModal(_ref) {
41
43
  onSubmit = _ref.onSubmit,
42
44
  formProps = _objectWithoutProperties(_ref, _excluded2);
43
45
 
46
+ var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
44
47
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, _objectSpread(_objectSpread({
45
48
  onSubmit: onSubmit
46
49
  }, formProps), {}, {
@@ -57,8 +60,6 @@ var FormModal = function FormModal(_ref) {
57
60
  };
58
61
 
59
62
  var renderFooter = function renderFooter() {
60
- var _labelOverrides$save, _labelOverrides$cance;
61
-
62
63
  if (footer) {
63
64
  return footer({
64
65
  formState: formState,
@@ -77,14 +78,16 @@ var FormModal = function FormModal(_ref) {
77
78
  marginBottom0: true,
78
79
  onClick: handleSubmit,
79
80
  type: "submit",
80
- children: (_labelOverrides$save = labelOverrides.save) !== null && _labelOverrides$save !== void 0 ? _labelOverrides$save : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
81
- id: "stripes-kint-components.saveAndClose"
81
+ children: kintIntl.formatKintMessage({
82
+ id: 'saveAndClose',
83
+ overrideValue: labelOverrides.saveAndClose
82
84
  })
83
85
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
84
86
  marginBottom0: true,
85
87
  onClick: handleClose,
86
- children: (_labelOverrides$cance = labelOverrides.cancel) !== null && _labelOverrides$cance !== void 0 ? _labelOverrides$cance : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
87
- id: "stripes-kint-components.cancel"
88
+ children: kintIntl.formatKintMessage({
89
+ id: 'cancel',
90
+ overrideValue: labelOverrides.cancel
88
91
  })
89
92
  })]
90
93
  });
@@ -106,6 +109,8 @@ var FormModal = function FormModal(_ref) {
106
109
 
107
110
  FormModal.propTypes = {
108
111
  children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node, _propTypes.default.func]),
112
+ intlKey: _propTypes.default.string,
113
+ intlNS: _propTypes.default.string,
109
114
  labelOverrides: _propTypes.default.object,
110
115
  modalProps: _propTypes.default.shape({
111
116
  footer: _propTypes.default.func,
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _reactIntl = require("react-intl");
11
+
12
+ var _hooks = require("../hooks");
13
+
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+
16
+ var _excluded = ["fallbackMessage", "id", "intlKey", "intlNS", "overrideValue"];
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ 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; }
21
+
22
+ 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; }
23
+
24
+ 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; }
25
+
26
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
27
+
28
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
+
30
+ // This works analogously to useKintIntl's "formatKintMessage"
31
+ var FormattedKintMessage = function FormattedKintMessage(_ref) {
32
+ var _intlObj$messages2;
33
+
34
+ var fallbackMessage = _ref.fallbackMessage,
35
+ id = _ref.id,
36
+ passedIntlKey = _ref.intlKey,
37
+ passedIntlNS = _ref.intlNS,
38
+ overrideValue = _ref.overrideValue,
39
+ formattedMessageProps = _objectWithoutProperties(_ref, _excluded);
40
+
41
+ var intlKey = (0, _hooks.useIntlKey)(passedIntlKey, passedIntlNS);
42
+ var intlObj = (0, _reactIntl.useIntl)();
43
+
44
+ if (overrideValue) {
45
+ var _intlObj$messages;
46
+
47
+ // Version 3 is a breaking change, where labelOverrides must be strings.
48
+ if (typeof overrideValue !== 'string') {
49
+ throw new Error('Override values must be strings as of stripes-kint-components ^3.0.0');
50
+ }
51
+
52
+ if ((_intlObj$messages = intlObj.messages) !== null && _intlObj$messages !== void 0 && _intlObj$messages[overrideValue]) {
53
+ // We've been passed a key as an override, return formattedMessage with it
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, _objectSpread({
55
+ id: overrideValue
56
+ }, formattedMessageProps));
57
+ } // At this stage we have an overrideValue that's not a key, return it.
58
+
59
+
60
+ return overrideValue;
61
+ } // If key does not exist in intl, and we have a specified "fallbackMessage", use that
62
+ // (FallbackMessage works like defaultMessage but with no warning)
63
+
64
+
65
+ if (!((_intlObj$messages2 = intlObj.messages) !== null && _intlObj$messages2 !== void 0 && _intlObj$messages2["".concat(intlKey, ".").concat(id)]) && fallbackMessage) {
66
+ var _intlObj$messages3;
67
+
68
+ // Allow fallback message to be an intl key
69
+ if ((_intlObj$messages3 = intlObj.messages) !== null && _intlObj$messages3 !== void 0 && _intlObj$messages3[fallbackMessage]) {
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, _objectSpread({
71
+ id: fallbackMessage
72
+ }, formattedMessageProps));
73
+ }
74
+
75
+ return fallbackMessage;
76
+ }
77
+
78
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, _objectSpread({
79
+ id: "".concat(intlKey, ".").concat(id)
80
+ }, formattedMessageProps));
81
+ };
82
+
83
+ FormattedKintMessage.propTypes = {
84
+ fallbackMessage: _propTypes.default.string,
85
+ id: _propTypes.default.string.isRequired,
86
+ intlKey: _propTypes.default.string,
87
+ intlNS: _propTypes.default.string,
88
+ overrideValue: _propTypes.default.string
89
+ };
90
+ var _default = FormattedKintMessage;
91
+ exports.default = _default;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _FormattedKintMessage.default;
10
+ }
11
+ });
12
+
13
+ var _FormattedKintMessage = _interopRequireDefault(require("./FormattedKintMessage"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -13,14 +13,14 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
15
 
16
- var _reactIntl = require("react-intl");
17
-
18
16
  var _components = require("@folio/stripes/components");
19
17
 
20
18
  var _IconSelect = _interopRequireDefault(require("../../../styles/IconSelect.css"));
21
19
 
22
20
  var _RichSelect = _interopRequireWildcard(require("../RichSelect"));
23
21
 
22
+ var _FormattedKintMessage = _interopRequireDefault(require("../FormattedKintMessage"));
23
+
24
24
  var _jsxRuntime = require("react/jsx-runtime");
25
25
 
26
26
  var _excluded = ["className"];
@@ -70,24 +70,28 @@ var IconSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
70
70
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
71
71
  id = _ref.id,
72
72
  input = _ref.input,
73
+ passedIntlKey = _ref.intlKey,
74
+ passedIntlNS = _ref.intlNS,
73
75
  label = _ref.label,
74
76
  meta = _ref.meta,
75
- _ref$notSet = _ref.notSet,
76
- notSet = _ref$notSet === void 0 ? {
77
- icon: 'ellipsis',
78
- value: '',
79
- label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
80
- id: "stripes-kint-components.iconSelect.notSet"
81
- })
82
- } : _ref$notSet,
77
+ notSet = _ref.notSet,
83
78
  onChange = _ref.onChange,
84
79
  _ref$options = _ref.options,
85
80
  userOptions = _ref$options === void 0 ? [] : _ref$options,
86
81
  _ref$required = _ref.required,
87
82
  required = _ref$required === void 0 ? false : _ref$required,
88
83
  value = _ref.value;
89
- // Options with notSet
90
- var options = [notSet].concat(_toConsumableArray(userOptions));
84
+ var defaultNotSet = {
85
+ icon: 'ellipsis',
86
+ value: '',
87
+ label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormattedKintMessage.default, {
88
+ id: "notSet",
89
+ intlKey: passedIntlKey,
90
+ intlNS: passedIntlNS
91
+ })
92
+ }; // Options with notSet
93
+
94
+ var options = [notSet !== null && notSet !== void 0 ? notSet : defaultNotSet].concat(_toConsumableArray(userOptions));
91
95
 
92
96
  var _useSelectedOption = (0, _RichSelect.useSelectedOption)(),
93
97
  _useSelectedOption2 = _slicedToArray(_useSelectedOption, 2),
@@ -158,6 +162,8 @@ IconSelect.propTypes = {
158
162
  disabled: _propTypes.default.bool,
159
163
  id: _propTypes.default.string,
160
164
  input: _propTypes.default.object,
165
+ intlKey: _propTypes.default.string,
166
+ intlNS: _propTypes.default.string,
161
167
  label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func, _propTypes.default.node]),
162
168
  meta: _propTypes.default.object,
163
169
  notSet: _propTypes.default.shape({